summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Namers.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Namers.scala10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index b0cfa6a559..8f20f2a120 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1239,8 +1239,14 @@ trait Namers { self: Analyzer =>
case ImportSelector(from, _, to, _) :: rest =>
if (from != nme.WILDCARD && base != ErrorType) {
isValidSelector(from) {
- if (currentRun.compileSourceFor(expr, from))
- return typeSig(tree)
+ if (currentRun.compileSourceFor(expr, from)) {
+ // XXX This used to be "return typeSig(tree)" but since this method
+ // returns Unit, that is deceptive at best. Just in case it is side-effecting
+ // somehow, I left the call in before the return; if you know it is
+ // not side effecting, please delete the call.
+ typeSig(tree)
+ return
+ }
def notMember = context.error(tree.pos, from.decode + " is not a member of " + expr)
// for Java code importing Scala objects