[Issue 9236] New: CTFE ice on switch + with(EnumType)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Dec 28 05:56:25 PST 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 at puremagic.com
        ReportedBy: dmitry.olsh at gmail.com


--- Comment #0 from Dmitry Olshansky <dmitry.olsh at 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: -------


More information about the Digitalmars-d-bugs mailing list