www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9236] New: CTFE ice on switch + with(EnumType)

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

           Summary: CTFE ice on switch + with(EnumType)
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



05:56:24 PST ---
Sample, tested on 2.061alpha:

enum Command{
    Char,
    Any,
};

bool test(Command cmd)
{
    //if with(Command) removed and Any --> Command.Any it works
    switch(cmd) with(Command)
    {
    case Any:
        return true;
    default:
        return false;
    }
}

enum x = test(Command.Any);

Assertion failure: '!istate->start' on line 1122 in file 'interpret.c'


If I swap switch(cmd) with(Command) to with(Command) switch(cmd) it gives:

ctfe_ice.d(8): Error: Cannot interpret Command at compile time
ctfe_ice.d(17):        called from here: test(cast(Command)1)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 28 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9236


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



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

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




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

https://github.com/D-Programming-Language/dmd/commit/d8361c35dca447d10cd4cfe6465b35ec1255767e
Fix issue 9236 CTFE ice on switch + with(EnumType)

When it's with(Type), dont try to interpret it, it's a no-op.

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


Kenji Hara <k.hara.pg 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: -------
Jan 08 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9236




Commit pushed to dmd-1.x at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/d5b139e2685657200b520946f1a5b9117510b272
Fix issue 9236 CTFE ice on switch + with(EnumType)

When it's with(Type), dont try to interpret it, it's a no-op.

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


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com
            Version|D2                          |D1 & D2



11:33:22 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1908

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