www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11328] New: Nulled type template instantiation cached so all usages of null returns the same result

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

           Summary: Nulled type template instantiation cached so all
                    usages of null returns the same result
           Product: D
           Version: D2
          Platform: All
               URL: http://forum.dlang.org/thread/gfdqabtlqiwatkowmtxy for
                    um.dlang.org
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: simendsjo gmail.com


--- Comment #0 from simendsjo <simendsjo gmail.com> 2013-10-23 01:20:51 PDT ---
See also: http://forum.dlang.org/thread/gfdqabtlqiwatkowmtxy forum.dlang.org

template A(alias T) {
    alias A = T;
}

void main() {
    struct S { }
    static assert(is(typeof(A!(cast(S*)null)) == S*));
    //pragma(msg, typeof(A!null)); // S*
    static assert(is(typeof(A!(null) == typeof(null)))); // still S*
}

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