[Issue 9709] New: ice with template and alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 13 10:20:08 PDT 2013


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

           Summary: ice with template and alias this
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: zheny at list.ru


--- Comment #0 from Zhenya Chapovsky <zheny at list.ru> 2013-03-13 10:20:03 PDT ---
This code fails with message dmd: aliasthis.c:100: virtual void
AliasThis::semantic(Scope*): Assertion `t' failed.

import std.stdio;

struct Tuple(T...)
{
    alias T expand;
    alias expand this;
}

template Foo(alias A,alias B)
{
    static assert(is(A == Tuple!(1,int,"foo")));
    static assert(is(B == Tuple!(2,double,"bar")));
    static int dummy = 0;
}

void main()
{
    alias Tuple!(1,int,"foo") A;
    alias Tuple!(2,double,"bar") B;
    writeln(Foo!(A,B).dummy);
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list