Mercurial > projects > ddmd
diff dmd/EnumDeclaration.d @ 138:90821c10b6a7
2.039
author | Trass3r |
---|---|
date | Tue, 14 Sep 2010 00:00:24 +0200 |
parents | e28b18c23469 |
children | e3afd1303184 |
line wrap: on
line diff
--- 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;