diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-19 12:50:12 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-12-19 12:50:12 -0800 |
commit | 3019ed448d0a607490d56f09b395c9b5379abb31 (patch) | |
tree | 3a6ac62f01b33a9dcd53cb313c61dd99e7ab8088 /src/compiler | |
parent | 7c23d525ccb413d8ff3e4cc6b442e7e864608609 (diff) | |
parent | 1feee89e3c7b8edc7a7e2a724f9d9c3194ddf171 (diff) | |
download | scala-3019ed448d0a607490d56f09b395c9b5379abb31.tar.gz scala-3019ed448d0a607490d56f09b395c9b5379abb31.tar.bz2 scala-3019ed448d0a607490d56f09b395c9b5379abb31.zip |
Merge pull request #1784 from paulp/pr/is-name-in-scope
Integrate isNameInScope in Contexts.
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala index c0d2f44c7b..a494a4a524 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala @@ -436,16 +436,7 @@ trait Contexts { self: Analyzer => case _ => outer.isLocal() } - /** Fast path for some slow checks (ambiguous assignment in Refchecks, and - * existence of __match for MatchTranslation in virtpatmat.) This logic probably - * needs improvement. - */ - def isNameInScope(name: Name) = ( - enclosingContextChain exists (ctx => - (ctx.scope.lookupEntry(name) != null) - || (ctx.owner.rawInfo.member(name) != NoSymbol) - ) - ) + def isNameInScope(name: Name) = lookupSymbol(name, _ => true).isSuccess // nextOuter determines which context is searched next for implicits // (after `this`, which contributes `newImplicits` below.) In |