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, 5 insertions, 5 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Namers.scala b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
index 4b888f5a76..b578759c85 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Namers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Namers.scala
@@ -1239,13 +1239,13 @@ trait Namers { self: Analyzer =>
isValidSelector(from) {
if (currentRun.compileSourceFor(expr, from))
return typeSig(tree)
+
+ def notMember = context.error(tree.pos, from.decode + " is not a member of " + expr)
// for Java code importing Scala objects
- if (from.endsWith(nme.raw.DOLLAR))
- isValidSelector(from.subName(0, from.length -1)) {
- context.error(tree.pos, from.decode + " is not a member of " + expr)
- }
+ if (from endsWith nme.raw.DOLLAR)
+ isValidSelector(from stripEnd "$")(notMember)
else
- context.error(tree.pos, from.decode + " is not a member of " + expr)
+ notMember
}
if (checkNotRedundant(tree.pos, from, to))