[Issue 13500] New: Wrong ambiguity error in second template instantiation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Sep 19 20:13:24 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13500

          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 at puremagic.com
          Reporter: timon.gehr at gmx.ch

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

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.

--


More information about the Digitalmars-d-bugs mailing list