[Issue 3628] New: can't cast null to int

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 17 13:41:19 PST 2009


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

           Summary: can't cast null to int
           Product: D
           Version: 1.047
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: patch, rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir <thecybershadow at gmail.com> 2009-12-17 13:41:18 PST ---
Created an attachment (id=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).

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