diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-29 11:20:19 +0100 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-12-17 17:22:22 -0800 |
commit | 1feee89e3c7b8edc7a7e2a724f9d9c3194ddf171 (patch) | |
tree | fb3f38e1904bc20dbe0958495bf07baae9eec8f8 /src/reflect | |
parent | e14917528e1c080a7f10785e21de36f3a7769718 (diff) | |
download | scala-1feee89e3c7b8edc7a7e2a724f9d9c3194ddf171.tar.gz scala-1feee89e3c7b8edc7a7e2a724f9d9c3194ddf171.tar.bz2 scala-1feee89e3c7b8edc7a7e2a724f9d9c3194ddf171.zip |
Integrate isNameInScope in Contexts.
This was a partial implementation of symbol lookup used for
short-circuiting some expensive tests. After rescuing lookup
from typedIdent, it should only be a wrapper around
lookupSymbol (as it now is.)
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Scopes.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index 04f1d73360..b1cfaa4774 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -10,8 +10,8 @@ trait Scopes extends api.Scopes { self: SymbolTable => /** An ADT to represent the results of symbol name lookups. */ - sealed trait NameLookup { def symbol: Symbol } - case class LookupSucceeded(qualifier: Tree, symbol: Symbol) extends NameLookup + sealed trait NameLookup { def symbol: Symbol ; def isSuccess = false } + case class LookupSucceeded(qualifier: Tree, symbol: Symbol) extends NameLookup { override def isSuccess = true } case class LookupAmbiguous(msg: String) extends NameLookup { def symbol = NoSymbol } case class LookupInaccessible(symbol: Symbol, msg: String) extends NameLookup case object LookupNotFound extends NameLookup { def symbol = NoSymbol } |