[Issue 2143] New: Mixed-in identifier is not recognized by static if

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jun 6 08:55:07 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2143

           Summary: Mixed-in identifier is not recognized by static if
           Product: D
           Version: 1.030
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: samukha at voliacable.com


May be related to 1113 and others
----
template Tuple(A...)
{
    alias A Tuple;
}

template Foo()
{
    mixin ("alias Tuple!(1) tuple;");

    static if (tuple[0] == 1)
    {
    }
}

alias Foo!() foo;
----
test.d(13): Error: undefined identifier tuple


Add an intermediate alias to work around it:
----
template Foo()
{
    mixin ("alias Tuple!(1) tuple;");

    alias tuple betterTuple;    
    static if (betterTuple[0] == 1)
    {
    }
}
----


-- 



More information about the Digitalmars-d-bugs mailing list