www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11226] New: Problems with typeof(null) and const

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: simen.kjaras gmail.com



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: -------
Oct 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11226




PDT ---
Another thing that fails with typeof(null):

assert(is(typeof(null) : const(typeof(null))));

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 30 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11226


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/2703

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 01 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11226




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/068f4e55d611054a8c6f80e8479884ce1d1b1c4c
fix Issue 11226 - Problems with typeof(null) and const

https://github.com/D-Programming-Language/dmd/commit/fec22e29d835977551fe808bfc63d1f73e6ae832


Issue 11226 - Problems with typeof(null) and const

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 03 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11226


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


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