[Issue 11226] New: Problems with typeof(null) and const

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Oct 11 10:53:01 PDT 2013


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

           Summary: Problems with typeof(null) and const
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: simen.kjaras at gmail.com


--- Comment #0 from Simen Kjaeraas <simen.kjaras at gmail.com> 2013-10-11 10:53:00 PDT ---
typeof(null) a;
    const typeof(null) b = a;
    a = b;
    assert(a == b);

Only the first line of the above actually compiles. The others complain:

cannot implicitly convert expression (a) of type typeof(null) to typeof(null)
cannot implicitly convert expression (b) of type typeof(null) to typeof(null)
incompatible types for ((a) == (b)): 'typeof(null)' and 'typeof(null)'


In addition to typeof(null) not being implicitly castable to
const(typeof(null)), and vice versa, the error message is misleading - no
indication of constness is given in the error messages.

-- 
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