www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13500] New: Wrong ambiguity error in second template


          Issue ID: 13500
           Summary: Wrong ambiguity error in second template instantiation
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: timon.gehr gmx.ch

With DMD 2.066.0, this compiles with version=A or version=B, but noth with both

import std.typecons;

mixin template WorkingTypedef(string i,T,T init=T.init)/+if(...)+/{
    mixin Typedef!(T,init);
    mixin(`alias `~i~` =Typedef;`);
version(A) mixin WorkingTypedef!("Name2",int,2);
version(B) mixin WorkingTypedef!("Name1",int);

The code should compile in all three cases.

Sep 19 2014