http://d.puremagic.com/issues/show_bug.cgi?id=4322
Don <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Don <[email protected]> 2010-06-15 14:55:14 PDT --- (In reply to comment #1) > FWIW, removing line 100 in init.c allows simple examples to > compile and run correctly. Of course I'm not 100% clear on why the > error message was there in the first place. :) > > diff --git a/trunk/src/init.c b/trunk/src/init.c > index ed3a091..cf9bc72 100644 > --- a/trunk/src/init.c > +++ b/trunk/src/init.c > @@ -97,7 +97,6 @@ Initializer *VoidInitializer::semantic(Scope *sc, Type > *t) > > Expression *VoidInitializer::toExpression() > { > - error(loc, "void initializer has no value"); > return new IntegerExp(0); > } > > best, > Graham That's too general, the error message is important in other places. I think the correct fix for the bug, is to allow a void initializer to be used inside another initializer. This might be a bug in the array literal initializers in mtype.c, which (from memory) creates an array literal by converting the initializers to expressions. At least in the case where ALL initializers are void, the final initializer could also be void. So the test case should be transformed into: Foo f = void; But the simplest solution is probably to change all members into default initializers, if they are a VoidInitializers. I recommend to put a breakpoint on the error message and find out where it's being called from. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
