diff dmd/mtype.c @ 913:29c0d1194033

Fix #198 and #199 by making CTFE on static struct initializers work. Renamed SymbolDeclaration to StaticStructInitDeclaration to make its usage clearer.
author Christian Kamm <kamm incasoftware de>
date Sun, 01 Feb 2009 20:20:56 +0100
parents 177afbf5297b
children 7985bb036db4
line wrap: on
line diff
--- a/dmd/mtype.c	Fri Jan 30 07:51:50 2009 +0100
+++ b/dmd/mtype.c	Sun Feb 01 20:20:56 2009 +0100
@@ -4584,14 +4584,12 @@
 }
 
 Expression *TypeStruct::defaultInit(Loc loc)
-{   Symbol *s;
-    Declaration *d;
+{   Declaration *d;
 
 #if LOGDEFAULTINIT
     printf("TypeStruct::defaultInit() '%s'\n", toChars());
 #endif
-    s = sym->toInitializer();
-    d = new SymbolDeclaration(sym->loc, s, sym);
+    d = new StaticStructInitDeclaration(sym->loc, sym);
     assert(d);
     d->type = this;
     return new VarExp(sym->loc, d);