diff options
author | Martin Odersky <odersky@gmail.com> | 2014-12-16 18:02:19 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-12-16 18:02:19 +0100 |
commit | 009a1e69e7bdc3df1b085d2271042607c83b1e82 (patch) | |
tree | 6d1acf8147a23e6f13015a34abefbdf96f147be4 /src/dotty/tools/dotc/core/Contexts.scala | |
parent | 16554c0efe2d09ab3ef760522f0811a964f7ee84 (diff) | |
download | dotty-009a1e69e7bdc3df1b085d2271042607c83b1e82.tar.gz dotty-009a1e69e7bdc3df1b085d2271042607c83b1e82.tar.bz2 dotty-009a1e69e7bdc3df1b085d2271042607c83b1e82.zip |
Made gadt map better encapsulated.
Diffstat (limited to 'src/dotty/tools/dotc/core/Contexts.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Contexts.scala | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index 2477fd4a4..f048c27aa 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -601,7 +601,12 @@ object Contexts { implicit val ctx: Context = initctx } - class GADTMap(var bounds: SimpleMap[Symbol, TypeBounds]) + class GADTMap(initBounds: SimpleMap[Symbol, TypeBounds]) { + private var myBounds = initBounds + def setBounds(sym: Symbol, b: TypeBounds): Unit = + myBounds = myBounds.updated(sym, b) + def bounds = myBounds + } /** Initial size of superId table */ private final val InitialSuperIdsSize = 4096 |