summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-02-08 12:12:46 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-02-08 12:12:46 +0000
commitfa84b3319010c452d767351d72c7a4c962425fb4 (patch)
tree2e03b35f4c0db789793ca8a5bbe78d2118085b3d /src
parent496dc761189182e04c424750ba63077d62dcf78b (diff)
downloadscala-fa84b3319010c452d767351d72c7a4c962425fb4.tar.gz
scala-fa84b3319010c452d767351d72c7a4c962425fb4.tar.bz2
scala-fa84b3319010c452d767351d72c7a4c962425fb4.zip
Closes #4215. review by odersky
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/symtab/Types.scala13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/symtab/Types.scala b/src/compiler/scala/tools/nsc/symtab/Types.scala
index c7e624d96e..54e5978e7b 100644
--- a/src/compiler/scala/tools/nsc/symtab/Types.scala
+++ b/src/compiler/scala/tools/nsc/symtab/Types.scala
@@ -3810,8 +3810,17 @@ A type's typeSymbol should never be inspected directly.
} else if (sym.isModuleClass) {
val adaptedSym = adaptToNewRun(pre, sym.sourceModule)
// Handle nested objects properly
- val result = if (adaptedSym.isLazy) adaptedSym.lazyAccessor else adaptedSym.moduleClass
- assert(result != NoSymbol, sym+" "+adaptedSym+" "+adaptedSym.isLazy)
+ val result0 = if (adaptedSym.isLazy) adaptedSym.lazyAccessor else adaptedSym.moduleClass
+ val result = if (result0 == NoSymbol)
+ // The only possible way we got here is when
+ // object is defined inside the method and unfortunately
+ // we have no way of retrieving that information (and using it)
+ // at this point, so just use the old symbol.
+ // This also means that sym.sourceModule == adaptedSym since
+ // pre == NoPrefix. see #4215
+ sym
+ else result0
+
result
} else if ((pre eq NoPrefix) || (pre eq NoType) || sym.isPackageClass) {
sym