Bug 3628 – can't cast null to int

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2009-12-17T13:41:00Z
Last change time
2014-04-18T09:12:04Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
dlang-bugzilla

Attachments

IDFilenameSummaryContent-TypeSize
527bug3628.patchProposed patchtext/plain792

Comments

Comment #0 by dlang-bugzilla — 2009-12-17T13:41:18Z
Created attachment 527 Proposed patch Testcase: void main() { int a = cast(int)null; } DMD 1.046 compiles fine. DMD 1.047 outputs: test.d(3): Error: Integer constant expression expected instead of null test.d(3): Error: Integer constant expression expected instead of null Attaching proposed patch (needs review).
Comment #1 by dlang-bugzilla — 2009-12-17T13:49:58Z
I forgot to mention... this bug breaks the DFL library ( http://www.dprogramming.com/dfl.php ). Makes me wonder if I'm the only library's user left.
Comment #2 by leandro.lucarella — 2009-12-29T08:56:03Z
Comment #3 by leandro.lucarella — 2009-12-29T08:58:06Z
Comment #4 by bugzilla — 2009-12-31T11:18:33Z
Fixed dmd 1.054