diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-06 11:51:27 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-06 11:51:27 -0800 |
commit | b1cb6578bdbdfaa66d3cf09f40dfc1511f7e9711 (patch) | |
tree | 3db1756fa8f6f6d482ea08ff4e36a7c568fa478a /src/compiler | |
parent | d64f99f7aaa988cd3e975993f88e6a96e1c16c21 (diff) | |
parent | ff9cfd9eb7f47be69d302f73de08a00303249a0d (diff) | |
download | scala-b1cb6578bdbdfaa66d3cf09f40dfc1511f7e9711.tar.gz scala-b1cb6578bdbdfaa66d3cf09f40dfc1511f7e9711.tar.bz2 scala-b1cb6578bdbdfaa66d3cf09f40dfc1511f7e9711.zip |
Merge pull request #1697 from retronym/ticket/6745-2
Don't return unimportables from importedSymbol.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 9 |
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) "_" |