Thread overview
[Issue 3628] New: can't cast null to int
Dec 17, 2009
Vladimir
Dec 17, 2009
Vladimir
Dec 29, 2009
Leandro Lucarella
Dec 29, 2009
Leandro Lucarella
Dec 31, 2009
Walter Bright
December 17, 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@puremagic.com
        ReportedBy: thecybershadow@gmail.com


--- Comment #0 from Vladimir <thecybershadow@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: -------
December 17, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3628



--- Comment #1 from Vladimir <thecybershadow@gmail.com> 2009-12-17 13:49:58 PST ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3628


Leandro Lucarella <llucax@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |llucax@gmail.com


--- Comment #2 from Leandro Lucarella <llucax@gmail.com> 2009-12-29 08:56:03 PST ---
http://www.dsource.org/projects/dmd/changeset/316

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 29, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3628



--- Comment #3 from Leandro Lucarella <llucax@gmail.com> 2009-12-29 08:58:06 PST ---
http://www.dsource.org/projects/dmd/changeset/316

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 31, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=3628


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2009-12-31 11:18:33 PST ---
Fixed dmd 1.054

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