From 009a1e69e7bdc3df1b085d2271042607c83b1e82 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 16 Dec 2014 18:02:19 +0100 Subject: Made gadt map better encapsulated. --- src/dotty/tools/dotc/core/Contexts.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/dotty/tools/dotc/core/Contexts.scala') 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 -- cgit v1.2.3