From fdca21eb130a782580cf13df0eb74eb4bceb2370 Mon Sep 17 00:00:00 2001 From: Iulian Dragos Date: Wed, 13 Jun 2012 19:20:35 +0200 Subject: Don't use the BrowsingLoader for Java sources. When the presentation compiler needs a SourceLoader, instead of immediately adding the file to the compilation round it uses a fast parser to create symbols for all top-level class definitions. The fast parser assumes Scala sources, which is not always the case. --- src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/compiler') diff --git a/src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala b/src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala index 25d835790e..52e971f1e7 100644 --- a/src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala +++ b/src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala @@ -105,7 +105,7 @@ abstract class BrowsingLoaders extends SymbolLoaders { */ override def enterToplevelsFromSource(root: Symbol, name: String, src: AbstractFile) { try { - if (root.isEffectiveRoot) // RootClass or EmptyPackageClass + if (root.isEffectiveRoot || !src.name.endsWith(".scala")) // RootClass or EmptyPackageClass super.enterToplevelsFromSource(root, name, src) else browseTopLevel(root, src) -- cgit v1.2.3