diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-18 16:21:19 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-18 16:21:19 +0100 |
commit | 43fefd527e3ec424a6b1232aed63b50dd6a71342 (patch) | |
tree | 60e913d34f98f3d33e50e951a770f9b2251496c5 /src/dotty/tools/dotc/core/SymDenotations.scala | |
parent | 064974fd4877bcf77dc495f1dcef9dfd2d626435 (diff) | |
download | dotty-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/SymDenotations.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/SymDenotations.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala index a91b61692..b4927b5d4 100644 --- a/src/dotty/tools/dotc/core/SymDenotations.scala +++ b/src/dotty/tools/dotc/core/SymDenotations.scala @@ -258,7 +258,7 @@ object SymDenotations { */ final private[core] def currentPackageDecls(implicit ctx: Context): MutableScope = myInfo match { case pinfo: SymbolLoaders # PackageLoader => pinfo.currentDecls - case _ => unforcedDecls.asInstanceOf[MutableScope] + case _ => unforcedDecls.openForMutations } // ------ Names ---------------------------------------------- @@ -1235,7 +1235,7 @@ object SymDenotations { def enter(sym: Symbol, scope: Scope = EmptyScope)(implicit ctx: Context): Unit = { val mscope = scope match { case scope: MutableScope => scope - case _ => unforcedDecls.asInstanceOf[MutableScope] + case _ => unforcedDecls.openForMutations } if (this is PackageClass) { val entry = mscope.lookupEntry(sym.name) @@ -1265,7 +1265,7 @@ object SymDenotations { */ def replace(prev: Symbol, replacement: Symbol)(implicit ctx: Context): Unit = { require(!(this is Frozen)) - unforcedDecls.asInstanceOf[MutableScope].replace(prev, replacement) + unforcedDecls.openForMutations.replace(prev, replacement) if (myMemberCache != null) myMemberCache invalidate replacement.name } @@ -1276,7 +1276,7 @@ object SymDenotations { */ def delete(sym: Symbol)(implicit ctx: Context) = { require(!(this is Frozen)) - info.decls.asInstanceOf[MutableScope].unlink(sym) + info.decls.openForMutations.unlink(sym) if (myMemberFingerPrint != FingerPrint.unknown) computeMemberFingerPrint if (myMemberCache != null) |