interpret.c assertion failure on enum.stringof mixin

strtr strtr at spam.com
Mon Feb 8 01:24:22 PST 2010


Don Wrote:

> Wow, seems like you and the compiler are at war...
> 
I had an even more horrid dmd crash some time ago, removing a circular selective import seemed to fix it. But I'm not sure and can't replicate it any more :(

> 
> Please put this into bugzilla. Title "ICE(interpret.c): mixin non-CTFE 
> function" or similar.
Done.
Ah, ICE = Internal Compiler Error :)
And, format isn't a CTFE-function?

Could you maybe also help me with this one?

enum E { A = 0, B, C }
char[] _mixin(int i) {
  return "e = " ~ (cast(E)i).stringof ~ ";";
}
void main() {
  E e;
  mixin( _mixin(1) );
} 
// Error: type E is not an expression

I just want to use a var to index an enum and then get its .stringof :)


More information about the Digitalmars-d-learn mailing list