aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Scopes.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-18 16:21:19 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-18 16:21:19 +0100
commit43fefd527e3ec424a6b1232aed63b50dd6a71342 (patch)
tree60e913d34f98f3d33e50e951a770f9b2251496c5 /src/dotty/tools/dotc/core/Scopes.scala
parent064974fd4877bcf77dc495f1dcef9dfd2d626435 (diff)
downloaddotty-43fefd527e3ec424a6b1232aed63b50dd6a71342.tar.gz
dotty-43fefd527e3ec424a6b1232aed63b50dd6a71342.tar.bz2
dotty-43fefd527e3ec424a6b1232aed63b50dd6a71342.zip
New method on scopes: openForMutations
Replaces `asInstanceOf[MutableScope]` calls.
Diffstat (limited to 'src/dotty/tools/dotc/core/Scopes.scala')
-rw-r--r--src/dotty/tools/dotc/core/Scopes.scala10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Scopes.scala b/src/dotty/tools/dotc/core/Scopes.scala
index cd1eacc91..70bcbdee6 100644
--- a/src/dotty/tools/dotc/core/Scopes.scala
+++ b/src/dotty/tools/dotc/core/Scopes.scala
@@ -93,7 +93,7 @@ object Scopes {
/** Lookup next entry with same name as this one */
def lookupNextEntry(entry: ScopeEntry)(implicit ctx: Context): ScopeEntry
-
+
/** Lookup a symbol */
final def lookup(name: Name)(implicit ctx: Context): Symbol = {
val e = lookupEntry(name)
@@ -138,7 +138,9 @@ object Scopes {
}
def implicitDecls(implicit ctx: Context): List[TermRef] = Nil
-
+
+ def openForMutations: MutableScope = unsupported("openForMutations")
+
final def toText(printer: Printer): Text = printer.toText(this)
}
@@ -374,6 +376,8 @@ object Scopes {
}
syms
}
+
+ override def openForMutations: MutableScope = this
}
/** Create a new scope */
@@ -404,7 +408,7 @@ object Scopes {
/** The empty scope (immutable).
*/
object EmptyScope extends Scope {
- override def lastEntry = null
+ override private[dotc] def lastEntry = null
override def size = 0
override def nestingLevel = 0
override def toList = Nil