www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10783] New: ICE and bad diagnostics when using non-existent symbols in switch and with statements

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10783

           Summary: ICE and bad diagnostics when using non-existent
                    symbols in switch and with statements
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com



14:21:28 PDT ---
The code attempts to read a non-existent field, and also attempts to use a with
statement on a symbol that doesn't exist (usually an enum would be used)

-----
struct Event { }

void main()
{
    Event event;
    switch (event.type) with (En)
    {
        default:
    }
}
-----

test.d(8): Error: no property 'type' for type 'Event'
test.d(8): Error: '__error' must be of integral or string type, it is a _error_
test.d(8): Error: undefined identifier En
test.d(8): Deprecation: non-final switch statement without a default is
deprecated

After the errors DMD crashes. It's also interesting that the non-final switch
error occurred, even though there is actually a default switch in the code. The
__error's in the diagnostics should likely not show up to the user as well.

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


Henning Pohl <henning still-hidden.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice, pull
                 CC|                            |henning still-hidden.de



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

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




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

https://github.com/D-Programming-Language/dmd/commit/50d719a0fdf2594b08d50980f623abc2f0d870ba
fix issue 10783 - ICE and bad diagnostics when using non-existent
symbols in switch and with statements

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


fix issue 10783 - ICE and bad diagnostics when using non-existent symbols in
switch and with statements

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


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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