@@ -476,6 +476,7 @@ object Contexts {
476
476
def setRunInfo (runInfo : RunInfo ): this .type = { this .runInfo = runInfo; this }
477
477
def setDiagnostics (diagnostics : Option [StringBuilder ]): this .type = { this .diagnostics = diagnostics; this }
478
478
def setGadt (gadt : GADTMap ): this .type = { this .gadt = gadt; this }
479
+ def setFreshGADTBounds : this .type = setGadt(new GADTMap (gadt.bounds))
479
480
def setTypeComparerFn (tcfn : Context => TypeComparer ): this .type = { this .typeComparer = tcfn(this ); this }
480
481
def setSearchHistory (searchHistory : SearchHistory ): this .type = { this .searchHistory = searchHistory; this }
481
482
def setFreshNames (freshNames : FreshNameCreator ): this .type = { this .freshNames = freshNames; this }
@@ -493,7 +494,6 @@ object Contexts {
493
494
def setSetting [T ](setting : Setting [T ], value : T ): this .type =
494
495
setSettings(setting.updateIn(sstate, value))
495
496
496
- def setFreshGADTBounds : this .type = { this .gadt = new GADTMap (gadt.bounds); this }
497
497
498
498
def setDebug = setSetting(base.settings.debug, true )
499
499
}
@@ -532,7 +532,7 @@ object Contexts {
532
532
moreProperties = Map .empty
533
533
typeComparer = new TypeComparer (this )
534
534
searchHistory = new SearchHistory (0 , Map ())
535
- gadt = new GADTMap ( SimpleMap . Empty )
535
+ gadt = EmptyGADTMap
536
536
}
537
537
538
538
@ sharable object NoContext extends Context {
@@ -694,10 +694,14 @@ object Contexts {
694
694
implicit val ctx : Context = initctx
695
695
}
696
696
697
- class GADTMap (initBounds : SimpleMap [Symbol , TypeBounds ]) {
697
+ class GADTMap (initBounds : SimpleMap [Symbol , TypeBounds ]) extends util. DotClass {
698
698
private var myBounds = initBounds
699
699
def setBounds (sym : Symbol , b : TypeBounds ): Unit =
700
700
myBounds = myBounds.updated(sym, b)
701
701
def bounds = myBounds
702
702
}
703
+
704
+ @ sharable object EmptyGADTMap extends GADTMap (SimpleMap .Empty ) {
705
+ override def setBounds (sym : Symbol , b : TypeBounds ) = unsupported(" EmptyGADTMap.setBounds" )
706
+ }
703
707
}
0 commit comments