Bug 9236 – CTFE ice on switch + with(EnumType)

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-28T05:56:00Z
Last change time
2015-06-09T05:11:58Z
Keywords
CTFE, ice, pull
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2012-12-28T05:56:24Z
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)
Comment #1 by clugdbug — 2013-01-08T02:39:13Z
Comment #2 by github-bugzilla — 2013-01-08T06:41:09Z
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.
Comment #3 by github-bugzilla — 2013-04-18T11:23:06Z
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.
Comment #4 by bugzilla — 2013-04-18T11:33:22Z