summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-12-03 18:34:18 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-12-03 19:19:59 +0100
commitff9cfd9eb7f47be69d302f73de08a00303249a0d (patch)
tree53c628d274744bde211727b34677bd1fa5e82a4b /src/compiler
parent4b2330b3d3db4263a8b1e19b792596dd60d79045 (diff)
downloadscala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.tar.gz
scala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.tar.bz2
scala-ff9cfd9eb7f47be69d302f73de08a00303249a0d.zip
Don't return unimportables from importedSymbol.
Hardening against the symptom of SI-6745, which yielded: wat.scala:4: error: too many arguments for constructor Predef: ()object Predef def this() = this(0) ^ The fix for the underlying problem in that bug has been targetted at branch 2.10.x.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index 1af61d31ec..c0d2f44c7b 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -996,7 +996,14 @@ trait Contexts { self: Analyzer =>
if (settings.lint.value && selectors.nonEmpty && result != NoSymbol && pos != NoPosition)
recordUsage(current, result)
- result
+ // Harden against the fallout from bugs like SI-6745
+ //
+ // [JZ] I considered issuing a devWarning and moving the
+ // check inside the above loop, as I believe that
+ // this always represents a mistake on the part of
+ // the caller.
+ if (definitions isImportable result) result
+ else NoSymbol
}
private def selectorString(s: ImportSelector): String = {
if (s.name == nme.WILDCARD && s.rename == null) "_"