Thread overview
[Issue 9236] New: CTFE ice on switch + with(EnumType)
Dec 28, 2012
Dmitry Olshansky
Jan 08, 2013
Don
Jan 08, 2013
Kenji Hara
Apr 18, 2013
Walter Bright
December 28, 2012
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


--- Comment #0 from Dmitry Olshansky <dmitry.olsh@gmail.com> 2012-12-28 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: -------
January 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9236


Don <clugdbug@yahoo.com.au> changed:

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


--- Comment #1 from Don <clugdbug@yahoo.com.au> 2013-01-08 02:39:13 PST ---
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: -------
January 08, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9236



--- Comment #2 from github-bugzilla@puremagic.com 2013-01-08 06:41:09 PST ---
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: -------
January 08, 2013
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: -------
April 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9236



--- Comment #3 from github-bugzilla@puremagic.com 2013-04-18 11:23:06 PDT ---
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: -------
April 18, 2013
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


--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2013-04-18 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: -------