www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9855] New: Type comparison does not work properly with subtyping

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

           Summary: Type comparison does not work properly with subtyping
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-04-01
23:59:43 PDT ---
struct Tuple(Types...)
{
    alias TypeTuple = Types;
    alias TypeTuple this;
}

alias list = Tuple!int;

void main()
{
    static assert(is(list.TypeTuple[0] == int));  // ok
    pragma(msg, list[0]);  // 'int'
    static assert(is(list[0] == int));  // ng
}

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