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 {
601
601
implicit val ctx : Context = initctx
602
602
}
603
603
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
+ }
605
610
606
611
/** Initial size of superId table */
607
612
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 {
919
919
920
920
def narrowGADTBounds (tr : NamedType , bounds : TypeBounds ): Boolean =
921
921
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 }
923
923
924
924
// Tests around `matches`
925
925
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
675
675
val c = ctx.fresh.setFreshGADTBounds
676
676
for (sym <- gadtSyms)
677
677
if (! c.gadt.bounds.contains(sym))
678
- c.gadt.bounds = c.gadt.bounds.updated (sym, TypeBounds .empty)
678
+ c.gadt.setBounds (sym, TypeBounds .empty)
679
679
c
680
680
}
681
681
val pat1 = typedPattern(tree.pat, selType)(gadtCtx)
You can’t perform that action at this time.
0 commit comments