summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-04-29 17:16:48 -0700
committerPaul Phillips <paulp@improving.org>2012-04-29 19:09:06 -0700
commit94c63f5da548996535cad43142758c9405118828 (patch)
treec888993eb3120cbc6e1e4acc45023d941f5bb4e6 /src/compiler/scala/tools/nsc/typechecker/Contexts.scala
parente6d5d22d280909dacf635a0a2398158a1b1a6ae1 (diff)
downloadscala-94c63f5da548996535cad43142758c9405118828.tar.gz
scala-94c63f5da548996535cad43142758c9405118828.tar.bz2
scala-94c63f5da548996535cad43142758c9405118828.zip
Fighting bitrot with typing.
if (false && settings.debug.value) { ... } Date: 7 years ago *** empty log message *** That's way past the sell-by date for 'if (false && condition)'.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala')
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Contexts.scala11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
index e2d4efab83..4584ba032d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Contexts.scala
@@ -405,6 +405,17 @@ 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)
+ )
+ )
+
// nextOuter determines which context is searched next for implicits
// (after `this`, which contributes `newImplicits` below.) In
// most cases, it is simply the outer context: if we're owned by