diff options
author | Iulian Dragos <jaguarul@gmail.com> | 2012-06-13 19:20:35 +0200 |
---|---|---|
committer | Iulian Dragos <jaguarul@gmail.com> | 2012-06-13 19:20:35 +0200 |
commit | fdca21eb130a782580cf13df0eb74eb4bceb2370 (patch) | |
tree | a999e7ef418c2a237a94aaf6eb2ea6a31c930c24 | |
parent | 87e23f5f523fc1c5b6ece12f6a812f26820e4da7 (diff) | |
download | scala-fdca21eb130a782580cf13df0eb74eb4bceb2370.tar.gz scala-fdca21eb130a782580cf13df0eb74eb4bceb2370.tar.bz2 scala-fdca21eb130a782580cf13df0eb74eb4bceb2370.zip |
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.
-rw-r--r-- | src/compiler/scala/tools/nsc/symtab/BrowsingLoaders.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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) |