From 7a5ea2758ed4377feedd00e2acbb16274116a910 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Fri, 19 Aug 2011 16:25:32 +0000 Subject: New utilitly method to create scope with some e... New utilitly method to create scope with some elements. --- src/compiler/scala/reflect/internal/Scopes.scala | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/scala/reflect/internal/Scopes.scala b/src/compiler/scala/reflect/internal/Scopes.scala index c150abc7db..9cd67375ac 100644 --- a/src/compiler/scala/reflect/internal/Scopes.scala +++ b/src/compiler/scala/reflect/internal/Scopes.scala @@ -311,6 +311,13 @@ trait Scopes extends api.Scopes { self: SymbolTable => def newScope: Scope = new Scope + def newScopeWith(elems: Symbol*) = { + val scope = newScope + elems foreach scope.enter + scope + } + + /** The empty scope (immutable). */ object EmptyScope extends Scope { -- cgit v1.2.3