File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -601,7 +601,12 @@ object Contexts {
601601 implicit val ctx : Context = initctx
602602 }
603603
604- class GADTMap (var bounds : SimpleMap [Symbol , TypeBounds ])
604+ class GADTMap (initBounds : SimpleMap [Symbol , TypeBounds ]) {
605+ private var myBounds = initBounds
606+ def setBounds (sym : Symbol , b : TypeBounds ): Unit =
607+ myBounds = myBounds.updated(sym, b)
608+ def bounds = myBounds
609+ }
605610
606611 /** Initial size of superId table */
607612 private final val InitialSuperIdsSize = 4096
Original file line number Diff line number Diff line change @@ -919,7 +919,7 @@ class TypeComparer(initctx: Context) extends DotClass {
919919
920920 def narrowGADTBounds (tr : NamedType , bounds : TypeBounds ): Boolean =
921921 isSubType(bounds.lo, bounds.hi) &&
922- { ctx.gadt.bounds = ctx.gadt.bounds.updated (tr.symbol, bounds); true }
922+ { ctx.gadt.setBounds (tr.symbol, bounds); true }
923923
924924 // Tests around `matches`
925925
Original file line number Diff line number Diff line change @@ -675,7 +675,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit
675675 val c = ctx.fresh.setFreshGADTBounds
676676 for (sym <- gadtSyms)
677677 if (! c.gadt.bounds.contains(sym))
678- c.gadt.bounds = c.gadt.bounds.updated (sym, TypeBounds .empty)
678+ c.gadt.setBounds (sym, TypeBounds .empty)
679679 c
680680 }
681681 val pat1 = typedPattern(tree.pat, selType)(gadtCtx)
You can’t perform that action at this time.
0 commit comments