New utilitly method to create scope with some elements.

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25523 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
odersky 2011-08-19 16:25:32 +00:00
parent ffa3d7d3a6
commit c6a4a7a72b
1 changed files with 7 additions and 0 deletions

View File

@ -311,6 +311,13 @@ trait Scopes extends api.Scopes { self: SymbolTable =>
def newScope: Scope = new Scope def newScope: Scope = new Scope
def newScopeWith(elems: Symbol*) = {
val scope = newScope
elems foreach scope.enter
scope
}
/** The empty scope (immutable). /** The empty scope (immutable).
*/ */
object EmptyScope extends Scope { object EmptyScope extends Scope {