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


--- Comment #0 from Simen Kjaeraas <simen.kjaras 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: -------
Oct 11 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=11226



--- Comment #1 from Simen Kjaeraas <simen.kjaras gmail.com> 2013-10-30 14:51:44
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


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-11-01 20:21:19 PDT ---
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



--- Comment #3 from github-bugzilla puremagic.com 2013-11-03 07:32:05 PST ---
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
Merge pull request #2703 from 9rnsr/fix11226

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