diff options
author | Sean McDirmid <sean.mcdirmid@gmail.com> | 2008-05-19 10:34:02 +0000 |
---|---|---|
committer | Sean McDirmid <sean.mcdirmid@gmail.com> | 2008-05-19 10:34:02 +0000 |
commit | 1b0ebaf61753b07ab72cdc8681ac3dcbab0c12e4 (patch) | |
tree | ef089ebdd7afaf6c7a5b5d8ef930c5bb3b7c5159 /src | |
parent | 69bf02e9ebf3df796424129098c956134c7f0234 (diff) | |
download | scala-1b0ebaf61753b07ab72cdc8681ac3dcbab0c12e4.tar.gz scala-1b0ebaf61753b07ab72cdc8681ac3dcbab0c12e4.tar.bz2 scala-1b0ebaf61753b07ab72cdc8681ac3dcbab0c12e4.zip |
IDE fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/IdeSupport.scala | 15 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala | 3 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 4 |
3 files changed, 13 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala b/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala index 7fdac015f0..17891b3117 100644 --- a/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala +++ b/src/compiler/scala/tools/nsc/symtab/IdeSupport.scala @@ -93,9 +93,10 @@ trait IdeSupport extends SymbolTable { // added to global, not analyzers. val name = sym.name.toTermName e = scope.lookupEntry(name) while (e != null && !e.sym.hasFlag(MODULE)) e = scope.lookupNextEntry(e) - assert(e != null) - list += e.sym - scope unlink e.sym + if (e != null) { + list += e.sym + scope unlink e.sym + } else Console.println("XXX: module " + name + " does not exist anymore") //Console.println("RS-UNLINK: " + factory) } // if def is abstract, will only unlink its name @@ -108,10 +109,12 @@ trait IdeSupport extends SymbolTable { // added to global, not analyzers. } } else if (sym.hasGetter) { e = scope lookupEntry nme.getterName(sym.name) - while (e != null && !e.sym.isGetter) e = scope lookupNextEntry e + while (e != null && !e.sym.isGetter && e.sym.accessed != sym) { + e = scope lookupNextEntry e + } if (e != null) { val getter = e.sym - assert(getter.accessed == sym && !getter.isSetter) + assert(e.sym.accessed == sym && !e.sym.isSetter) list += getter scope unlink getter //Console.println("RS-UNLINK: " + getter) @@ -181,7 +184,7 @@ trait IdeSupport extends SymbolTable { // added to global, not analyzers. scope0.invalidate(sym.name) }} reuseMap.clear - tracedTypes.foreach{case (sym,oldType) => + tracedTypes.toList.foreach{case (sym,oldType) => if (sym.rawInfo != NoType && !sym.rawInfo.isComplete) { Console.println("XXX uncompleted: " + sym) } diff --git a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala index ea660e8010..97205e8f76 100644 --- a/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala +++ b/src/compiler/scala/tools/nsc/typechecker/IdeSupport.scala @@ -35,7 +35,8 @@ trait IdeSupport extends Analyzer { override def underlying = tpe override def complete(sym0 : Symbol) : Unit = { if (sym ne sym0) { - logError(sym + " "+sym.id + " vs. " + sym0.id + " we have a problem!", null) + logError("DUPLICATE: " + sym.fullNameString + " "+sym.id + " vs. " + sym0.id, null) + toComplete -= sym0 } toComplete -= sym val pos = sym0.pos match { diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala index 10d226ace2..01e22eae85 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala @@ -152,7 +152,7 @@ trait Namers { self: Analyzer => if (guess != null) prev = guess while (prev != null && (!prev.sym.hasRawInfo || !prev.sym.rawInfo.isComplete || (prev.sym.sourceFile == null && sym.getClass == prev.sym.getClass))) { - if (prev.sym.rawInfo.isComplete) { + if (!prev.sym.hasRawInfo || prev.sym.rawInfo.isComplete) { Console.println("DITCHING: " + prev.sym) } context.scope unlink prev.sym @@ -161,7 +161,7 @@ trait Namers { self: Analyzer => val sym0 = context.scope enter sym if (sym0 ne sym) { assert(true) - Console.println("WEIRD: " + sym0) + Console.println("WEIRD: " + sym0 + " vs. " + sym + " " + sym0.id + " " + sym.id + " " + sym.sourceFile + " " + sym0.sourceFile) } if (prev != null && (sym0 ne prev.sym) && conflict(sym0,prev.sym)) { doubleDefError(sym0.pos, prev.sym) |