# HG changeset patch # User Trass3r # Date 1284415224 -7200 # Node ID 90821c10b6a7e2ae53908030aee43c7dab0b8c54 # Parent 09c858522d55cc5911094ece819502f56b19fd41 2.039 diff -r 09c858522d55 -r 90821c10b6a7 dmd/ClassDeclaration.d --- a/dmd/ClassDeclaration.d Mon Sep 13 23:29:00 2010 +0200 +++ b/dmd/ClassDeclaration.d Tue Sep 14 00:00:24 2010 +0200 @@ -352,7 +352,7 @@ return; } if (symtab) - { if (!scope_) + { if (sizeok == 1 || !scope_) { //printf("\tsemantic for '%s' is already completed\n", toChars()); return; // semantic() already completed } diff -r 09c858522d55 -r 90821c10b6a7 dmd/EnumDeclaration.d --- a/dmd/EnumDeclaration.d Mon Sep 13 23:29:00 2010 +0200 +++ b/dmd/EnumDeclaration.d Tue Sep 14 00:00:24 2010 +0200 @@ -58,8 +58,10 @@ Expression minval; Expression defaultval; // default initializer } - bool isdeprecated; - + bool isdeprecated = false; + bool isdone = false; // 0: not done + // 1: semantic() successfully completed + this(Loc loc, Identifier id, Type memtype) { super(id); @@ -103,7 +105,7 @@ if (symtab) // if already done { - if (!scope_) + if (isdone || !scope_) return; // semantic() already completed } else @@ -146,7 +148,8 @@ return; } } -static if (false) { +static if (false) +{ // Decided to abandon this restriction for D 2.0 if (!memtype.isintegral()) { error("base type must be of integral type, not %s", memtype.toChars()); @@ -155,6 +158,8 @@ } } + isdone = true; + type = type.semantic(loc, sc); if (isAnonymous()) sce = sc; diff -r 09c858522d55 -r 90821c10b6a7 dmd/Global.d --- a/dmd/Global.d Mon Sep 13 23:29:00 2010 +0200 +++ b/dmd/Global.d Tue Sep 14 00:00:24 2010 +0200 @@ -39,7 +39,7 @@ string[] path; // Array of char*'s which form the import lookup path string[] filePath; // Array of char*'s which form the file import lookup path int structalign = 8; - string version_ = "v2.038"; + string version_ = "v2.039"; Param params; uint errors; // number of errors reported so far diff -r 09c858522d55 -r 90821c10b6a7 dmd/StructDeclaration.d --- a/dmd/StructDeclaration.d Mon Sep 13 23:29:00 2010 +0200 +++ b/dmd/StructDeclaration.d Tue Sep 14 00:00:24 2010 +0200 @@ -106,17 +106,22 @@ { Scope sc2; - //printf("+StructDeclaration.semantic(this=%p, '%s')\n", this, toChars()); + //writef("+StructDeclaration.semantic(this=%p, '%s', sizeok = %d)\n", this, toChars(), sizeok); - //static int count; if (++count == 20) *(char*)0=0; + //static int count; if (++count == 20) halt(); assert(type); if (!members) // if forward reference return; - if (symtab) - { if (!scope_) + if (sizeok == 1 || symtab) + { + if (!scope_) + { + // writef("already completed\n"); + scope_ = null; return; // semantic() already completed + } } else symtab = new DsymbolTable(); @@ -367,7 +372,7 @@ scope_ = scx ? scx : sc.clone(); scope_.setNoFree(); scope_.module_.addDeferredSemantic(this); - //printf("\tdeferring %s\n", toChars()); + writef("\tdeferring %s\n", toChars()); return; }