diff options
Diffstat (limited to 'src')
5 files changed, 14 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/Global.scala b/src/compiler/scala/tools/nsc/Global.scala index fe6a0ddb07..4037a0a5c7 100644 --- a/src/compiler/scala/tools/nsc/Global.scala +++ b/src/compiler/scala/tools/nsc/Global.scala @@ -705,5 +705,8 @@ class Global(var settings: Settings, var reporter: Reporter) extends Trees def unpickleIDEHook : (( => Type) => Type) = unpickleIDEHook0 def doPickleHash = false /* hook for IDE to detect source from class dependencies */ - def attachSourceToClass(clazz : ClassSymbol, tpe : LazyType, sourceFile : AbstractFile) = clazz.sourceFile = sourceFile + def attachSourceToClass(clazz : Symbol, tpe : LazyType, sourceFile : AbstractFile) = clazz match { + case clazz : ClassSymbol => clazz.sourceFile = sourceFile + case _ => + } } diff --git a/src/compiler/scala/tools/nsc/symtab/GenerateIdeMaps.scala b/src/compiler/scala/tools/nsc/symtab/GenerateIdeMaps.scala index 09fbf6111a..a137ed7490 100644 --- a/src/compiler/scala/tools/nsc/symtab/GenerateIdeMaps.scala +++ b/src/compiler/scala/tools/nsc/symtab/GenerateIdeMaps.scala @@ -171,7 +171,9 @@ abstract class GenerateIdeMaps extends SubComponent { return null } def walk(sourceFile : SourceFile, tree: Tree, uses : scala.collection.mutable.Map[Position,Symbol], defs : LinkedHashMap[Symbol,Position]) : Unit = { + val visited = new LinkedHashSet[Tree] def f(t : Tree) : Unit = { + if (!visited.add(t)) return def fs(l : List[Tree]) : Unit = { val i = l.elements while (i.hasNext) f(i.next) diff --git a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala index f341452095..0511870e76 100644 --- a/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/SymbolLoaders.scala @@ -286,6 +286,9 @@ abstract class SymbolLoaders { root match { case clazz : ClassSymbol => global.attachSourceToClass(clazz, this, if (sourceFile ne null) sourceFile else clazz.sourceFile) + case module : ModuleSymbol => + val clazz = module.moduleClass.asInstanceOf[ClassSymbol] + global.attachSourceToClass(module, this, if (sourceFile ne null) sourceFile else clazz.sourceFile) case _ => } if (root.sourceFile ne null) { diff --git a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala index ec00809529..d9300c8a17 100644 --- a/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala +++ b/src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala @@ -337,8 +337,10 @@ abstract class ClassfileParser { var sflags = transFlags(jflags) if ((sflags & DEFERRED) != 0) sflags = sflags & ~DEFERRED | ABSTRACT val c = pool.getClassSymbol(in.nextChar) - if (c != clazz) + if (c != clazz) { + assert(true) throw new IOException("class file '" + in.file + "' contains wrong " + c) + } val superType = if (isAnnotation) { in.nextChar; definitions.AnnotationClass.tpe } else pool.getSuperClass(in.nextChar).tpe val ifaceCount = in.nextChar diff --git a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala index 23d67f3a38..52fac051bc 100644 --- a/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala +++ b/src/compiler/scala/tools/nsc/typechecker/EtaExpansion.scala @@ -41,7 +41,8 @@ trait EtaExpansion { self: Analyzer => def freshName(pos : util.Position, n : Int) = { cnt += 1 if (pos == util.NoPosition) { - newTermName(unit.fresh.newName("eta$" + symbolHash + (cnt - 1))) + if (inIDE) newTermName( ("eta$" + symbolHash + (cnt - 1))) + else newTermName(unit.fresh.newName("eta$" + symbolHash + (cnt - 1))) } else if (n == 0) { newTermName(unit.fresh.newName(pos, "eta$" + symbolHash)) } else { |