summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2007-06-01 10:18:49 +0000
committerMartin Odersky <odersky@gmail.com>2007-06-01 10:18:49 +0000
commit2fb330d244ffcdfe7ee7115a544a0e4bcf5af97b (patch)
treee3ce20ff5190e6eaac8da61f09fc5b38fe35b196 /src/compiler/scala/tools/nsc
parent96d7374b9bfd9c4917793a55149ac227fabbc3f3 (diff)
downloadscala-2fb330d244ffcdfe7ee7115a544a0e4bcf5af97b.tar.gz
scala-2fb330d244ffcdfe7ee7115a544a0e4bcf5af97b.tar.bz2
scala-2fb330d244ffcdfe7ee7115a544a0e4bcf5af97b.zip
fixed bug1144
Diffstat (limited to 'src/compiler/scala/tools/nsc')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala2
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Scopes.scala6
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala9
3 files changed, 11 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala b/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala
index e1d72105ca..8b36ad819f 100644
--- a/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala
+++ b/src/compiler/scala/tools/nsc/symtab/AnnotationInfos.scala
@@ -41,7 +41,7 @@ trait AnnotationInfos {
None
}
- private val symbolReifier = new SymbolReifier {
+ private object symbolReifier extends SymbolReifier {
val symbols: AnnotationInfos.this.type = AnnotationInfos.this
}
diff --git a/src/compiler/scala/tools/nsc/symtab/Scopes.scala b/src/compiler/scala/tools/nsc/symtab/Scopes.scala
index d63d51ac09..64f83ca75d 100644
--- a/src/compiler/scala/tools/nsc/symtab/Scopes.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Scopes.scala
@@ -86,7 +86,7 @@ trait Scopes {
*/
private val MIN_HASH = 8
- if (size >= MIN_HASH) createHash
+ if (size >= MIN_HASH) createHash()
def this() = this(null: ScopeEntry)
@@ -138,7 +138,7 @@ trait Scopes {
elems.tail = hashtable(i)
hashtable(i) = elems
} else if (size >= MIN_HASH) {
- createHash
+ createHash()
}
}
@@ -157,7 +157,7 @@ trait Scopes {
enter(sym)
}
- private def createHash: unit = {
+ def createHash(): unit = {
hashtable = new Array[ScopeEntry](HASHSIZE)
enterInHash(elems)
}
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index 9cfec0d6e6..b26045f1d8 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -2176,11 +2176,16 @@ A type's symbol should never be inspected directly.
sym
} else {
var rebind0 = pre.findMember(sym.name, BRIDGE, 0, true)
+ if (rebind0 == NoSymbol && (sym hasFlag EXPANDEDNAME)) {
+ // problem is that symbols with expanded names might be in the wrong hash bucket
+ // in a previous scope. We account for that by re-creating the hash as a last attempt.
+ sym.owner.info.decls.createHash()
+ rebind0 = pre.findMember(sym.name, BRIDGE, 0, true)
+ }
+ if (rebind0 == NoSymbol) { assert(false, ""+pre+"."+sym+" does no longer exist, phase = "+phase) }
/** The two symbols have the same fully qualified name */
def corresponds(sym1: Symbol, sym2: Symbol): boolean =
sym1.name == sym2.name && (sym1.isPackageClass || corresponds(sym1.owner, sym2.owner))
- assert(sym != NoSymbol)
- if (rebind0 == NoSymbol) assert(false, ""+pre+"."+sym+" does no longer exist, phase = "+phase)
if (!corresponds(sym.owner, rebind0.owner)) {
if (settings.debug.value) Console.println("ADAPT1 pre = "+pre+", sym = "+sym+sym.locationString+", rebind = "+rebind0+rebind0.locationString)
val bcs = pre.baseClasses.dropWhile(bc => !corresponds(bc, sym.owner));