diff options
author | Paul Phillips <paulp@improving.org> | 2012-10-23 16:43:25 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-10-29 15:06:02 -0700 |
commit | 578c4c6c64250a12a0e625d1e54a74dbdad6d972 (patch) | |
tree | c3112dc73a9431f9673176fc788042456f92add8 /src/reflect/scala/reflect/internal/Scopes.scala | |
parent | e326d864d0a7fc9471695d89635c101a84592c58 (diff) | |
download | scala-578c4c6c64250a12a0e625d1e54a74dbdad6d972.tar.gz scala-578c4c6c64250a12a0e625d1e54a74dbdad6d972.tar.bz2 scala-578c4c6c64250a12a0e625d1e54a74dbdad6d972.zip |
Make LookupNotFound a case object.
Turns out putting a group of case classes at what feels like
the top level might not be top-level enough, like if your "top"
is Analyzer and you wind up with different outer pointers in
every instance of Typer. Moved the whole bundle to SymbolTable.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Scopes.scala')
-rw-r--r-- | src/reflect/scala/reflect/internal/Scopes.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/Scopes.scala b/src/reflect/scala/reflect/internal/Scopes.scala index 89332d0ae5..a4b541e34d 100644 --- a/src/reflect/scala/reflect/internal/Scopes.scala +++ b/src/reflect/scala/reflect/internal/Scopes.scala @@ -8,6 +8,14 @@ package internal 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 + 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 } + class ScopeEntry(val sym: Symbol, val owner: Scope) { /** the next entry in the hash bucket */ |