From 94c63f5da548996535cad43142758c9405118828 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Sun, 29 Apr 2012 17:16:48 -0700 Subject: 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)'. --- src/compiler/scala/tools/nsc/typechecker/Contexts.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/compiler/scala/tools/nsc/typechecker/Contexts.scala') 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 -- cgit v1.2.3