diff options
author | Paul Phillips <paulp@improving.org> | 2011-02-20 00:11:23 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-02-20 00:11:23 +0000 |
commit | 801c5cd82e1a7feb1f9515785ad36e0f0d2b993e (patch) | |
tree | 75718703f656ed1fc3005c4d7c2a2220c5c7b5b2 /src/compiler/scala/tools/nsc/typechecker/Namers.scala | |
parent | 3f96a415e123e5fc99c24e68ff5a9a53dc56e1fc (diff) | |
download | scala-801c5cd82e1a7feb1f9515785ad36e0f0d2b993e.tar.gz scala-801c5cd82e1a7feb1f9515785ad36e0f0d2b993e.tar.bz2 scala-801c5cd82e1a7feb1f9515785ad36e0f0d2b993e.zip |
Based on the frequency with which I hear questi...
Based on the frequency with which I hear questions about it and similar,
this error message assumes too much understanding.
scala> scala.collection.mutable.MultiMap(1, 2, 3) <console>:8: error:
value MultiMap is not a member of package scala.collection.mutable
Now it says:
scala> scala.collection.mutable.MultiMap(1, 2, 3) <console>:8: error:
object MultiMap is not a member of package scala.collection.mutable
Note: trait MultiMap exists, but it has no companion object.
No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Namers.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Namers.scala | 10 |
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)) |