changeset 87:b17640f0e4e8

Fixed a bug with a Scope.this(Scope enclosing) being called instead of Scope.clone() method (as a copy ctor replacement)
author korDen
date Mon, 30 Aug 2010 19:56:27 +0400
parents ee670dd808a8
children 23280d154c5b
files dmd/AnonDeclaration.d dmd/ClassDeclaration.d dmd/EnumDeclaration.d dmd/FuncDeclaration.d dmd/InterfaceDeclaration.d dmd/ProtDeclaration.d dmd/StructDeclaration.d dmd/TemplateDeclaration.d dmd/TemplateMixin.d dmd/Type.d dmd/VarDeclaration.d
diffstat 11 files changed, 16 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/dmd/AnonDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/AnonDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -100,7 +100,7 @@
 				//printf("\tsetting ad.sizeok %p to 2\n", ad);
 				if (!sc.anonAgg)
 				{
-					scope_ = scx ? scx : new Scope(sc);	///<
+					scope_ = scx ? scx : sc.clone();
 					scope_.setNoFree();
 					scope_.module_.addDeferredSemantic(this);
 				}
--- a/dmd/ClassDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/ClassDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -441,7 +441,7 @@
 						//error("forward reference of base class %s", baseClass.toChars());
 						// Forward reference of base class, try again later
 						//printf("\ttry later, forward reference of base class %s\n", tc.sym.toChars());
-						scope_ = scx ? scx : new Scope(sc);
+						scope_ = scx ? scx : sc.clone();
 						scope_.setNoFree();
 						if (tc.sym.scope_)
 							tc.sym.scope_.module_.addDeferredSemantic(tc.sym);
@@ -510,7 +510,7 @@
 			//error("forward reference of base class %s", baseClass.toChars());
 			// Forward reference of base, try again later
 			//printf("\ttry later, forward reference of base %s\n", baseClass.toChars());
-			scope_ = scx ? scx : new Scope(sc);
+			scope_ = scx ? scx : sc.clone();
 			scope_.setNoFree();
 			if (tc.sym.scope_)
 				tc.sym.scope_.module_.addDeferredSemantic(tc.sym);
@@ -705,7 +705,7 @@
 
 		sc = sc.pop();
 
-		scope_ = scx ? scx : new Scope(sc);
+		scope_ = scx ? scx : sc.clone();
 		scope_.setNoFree();
 		scope_.module_.addDeferredSemantic(this);
 
--- a/dmd/EnumDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/EnumDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -138,7 +138,7 @@
 				if (!sym.memtype || !sym.members || !sym.symtab || sym.scope_)
 				{	
 					// memtype is forward referenced, so try again later
-					scope_ = scx ? scx : new Scope(sc);
+					scope_ = scx ? scx : sc.clone();
 					scope_.setNoFree();
 					scope_.module_.addDeferredSemantic(this);
 					writef("\tdeferring %s\n", toChars());
--- a/dmd/FuncDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/FuncDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -840,7 +840,7 @@
 		/* Save scope for possible later use (if we need the
 		 * function internals)
 		 */
-		scope_ = new Scope(sc);
+		scope_ = sc.clone();
 		scope_.setNoFree();
 		return;
 
--- a/dmd/InterfaceDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/InterfaceDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -167,7 +167,7 @@
 					//error("forward reference of base class %s", baseClass.toChars());
 					// Forward reference of base, try again later
 					//printf("\ttry later, forward reference of base %s\n", b.base.toChars());
-					scope_ = scx ? scx : new Scope(sc);
+					scope_ = scx ? scx : sc.clone();
 					scope_.setNoFree();
 					scope_.module_.addDeferredSemantic(this);
 					return;
--- a/dmd/ProtDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/ProtDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -35,7 +35,7 @@
         if (sc.protection != protection || sc.explicitProtection != 1)
         {
            // create new one for changes
-           newsc = new Scope(sc);
+           newsc = sc.clone();
            newsc.flags &= ~SCOPE.SCOPEfree;
            newsc.protection = protection;
            newsc.explicitProtection = 1;
--- a/dmd/StructDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/StructDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -296,7 +296,7 @@
 		alignsize = 0;
 		structalign = 0;
 
-		scope_ = scx ? scx : new Scope(sc);
+		scope_ = scx ? scx : sc.clone();
 		scope_.setNoFree();
 		scope_.module_.addDeferredSemantic(this);
 		//printf("\tdeferring %s\n", toChars());
--- a/dmd/TemplateDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/TemplateDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -210,7 +210,7 @@
 		/* Remember Scope for later instantiations, but make
 		 * a copy since attributes can change.
 		 */
-		this.scope_ = new Scope(sc);	/// A light copy
+		this.scope_ = sc.clone();
 		this.scope_.setNoFree();
 
 		// Set up scope for parameters
--- a/dmd/TemplateMixin.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/TemplateMixin.d	Mon Aug 30 19:56:27 2010 +0400
@@ -168,7 +168,7 @@
 				{
 					// Forward reference
 					//printf("forward reference - deferring\n");
-					scope_ = scx ? scx : new Scope(sc);
+					scope_ = scx ? scx : sc.clone();
 					scope_.setNoFree();
 					scope_.module_.addDeferredSemantic(this);
 				}
--- a/dmd/Type.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/Type.d	Mon Aug 30 19:56:27 2010 +0400
@@ -1724,14 +1724,14 @@
 			}
 
 			e = new StringExp(loc, s, 'c');
-			Scope sc = new Scope();
+			scope Scope sc = new Scope();
 			e = e.semantic(sc);
 		}
 		else if (ident is Id.stringof_)
 		{	
 			string s = toChars();
 			e = new StringExp(loc, s, 'c');
-			Scope sc = new Scope();
+			scope Scope sc = new Scope();
 			e = e.semantic(sc);
 		}
 		else
@@ -1822,7 +1822,7 @@
 		{		
 			string s = e.toChars();
 			e = new StringExp(e.loc, s, 'c');
-			Scope sc2 = new Scope(); ///
+			scope Scope sc2 = new Scope(); ///
 			e = e.semantic(sc2);
 			return e;
 		}
--- a/dmd/VarDeclaration.d	Mon Aug 30 18:42:04 2010 +0400
+++ b/dmd/VarDeclaration.d	Mon Aug 30 19:56:27 2010 +0400
@@ -625,7 +625,7 @@
 version (DMDV2) {
 				/* Save scope for later use, to try again
 				 */
-				scope_ = new Scope(sc);
+				scope_ = sc.clone();
 				scope_.setNoFree();
 }
 			}
@@ -646,7 +646,7 @@
 				{
 				/* Save scope for later use, to try again
 				 */
-				scope_ = new Scope(sc);
+				scope_ = sc.clone();
 				scope_.setNoFree();
 				}
 ///}