changeset 138:90821c10b6a7

2.039
author Trass3r
date Tue, 14 Sep 2010 00:00:24 +0200
parents 09c858522d55
children bc45b1c53019
files dmd/ClassDeclaration.d dmd/EnumDeclaration.d dmd/Global.d dmd/StructDeclaration.d
diffstat 4 files changed, 21 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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
 		}
--- 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;
--- 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
--- 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;
 		}