# HG changeset patch # User korDen # Date 1283183894 -14400 # Node ID 23280d154c5b8eb14a11cf68a5ffdd5d65ed05b4 # Parent b17640f0e4e896b26fac17b226aec6ba98e1086a# Parent 50ebb404ddd9a1ee3428e7eb2eb1d860a5ee529f Merge diff -r 50ebb404ddd9 -r 23280d154c5b dmd/AnonDeclaration.d --- a/dmd/AnonDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/AnonDeclaration.d Mon Aug 30 19:58:14 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); } diff -r 50ebb404ddd9 -r 23280d154c5b dmd/ClassDeclaration.d --- a/dmd/ClassDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/ClassDeclaration.d Mon Aug 30 19:58:14 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); diff -r 50ebb404ddd9 -r 23280d154c5b dmd/EnumDeclaration.d --- a/dmd/EnumDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/EnumDeclaration.d Mon Aug 30 19:58:14 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()); diff -r 50ebb404ddd9 -r 23280d154c5b dmd/FuncDeclaration.d --- a/dmd/FuncDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/FuncDeclaration.d Mon Aug 30 19:58:14 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; diff -r 50ebb404ddd9 -r 23280d154c5b dmd/InterfaceDeclaration.d --- a/dmd/InterfaceDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/InterfaceDeclaration.d Mon Aug 30 19:58:14 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; diff -r 50ebb404ddd9 -r 23280d154c5b dmd/ProtDeclaration.d diff -r 50ebb404ddd9 -r 23280d154c5b dmd/StructDeclaration.d --- a/dmd/StructDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/StructDeclaration.d Mon Aug 30 19:58:14 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()); diff -r 50ebb404ddd9 -r 23280d154c5b dmd/TemplateDeclaration.d --- a/dmd/TemplateDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/TemplateDeclaration.d Mon Aug 30 19:58:14 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 diff -r 50ebb404ddd9 -r 23280d154c5b dmd/TemplateMixin.d --- a/dmd/TemplateMixin.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/TemplateMixin.d Mon Aug 30 19:58:14 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); } diff -r 50ebb404ddd9 -r 23280d154c5b dmd/Type.d --- a/dmd/Type.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/Type.d Mon Aug 30 19:58:14 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; } diff -r 50ebb404ddd9 -r 23280d154c5b dmd/VarDeclaration.d --- a/dmd/VarDeclaration.d Mon Aug 30 17:39:42 2010 +0200 +++ b/dmd/VarDeclaration.d Mon Aug 30 19:58:14 2010 +0400 @@ -626,7 +626,7 @@ version (DMDV2) { /* Save scope for later use, to try again */ - scope_ = new Scope(sc); + scope_ = sc.clone(); scope_.setNoFree(); } } @@ -647,7 +647,7 @@ { /* Save scope for later use, to try again */ - scope_ = new Scope(sc); + scope_ = sc.clone(); scope_.setNoFree(); } ///}