www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: samukha 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)
    {
    }
}
----


-- 
Jun 06 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2143


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed dmd 1.031 and 2.015


-- 
Jun 22 2008