www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9709] New: ice with template and alias this

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: zheny list.ru


--- Comment #0 from Zhenya Chapovsky <zheny 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: -------
Mar 13 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9709


Zhenya Chapovsky <zheny list.ru> changed:

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


--- Comment #1 from Zhenya Chapovsky <zheny list.ru> 2013-03-13 10:42:07 PDT ---
*** This issue has been marked as a duplicate of issue 8735 ***

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