File tree 1 file changed +7
-11
lines changed
compiler/src/dotty/tools/dotc/core
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -3828,18 +3828,14 @@ object Types {
3828
3828
3829
3829
private var validSuper : Period = Nowhere
3830
3830
private var cachedSuper : Type = _
3831
- private var myStableHash : Byte = 0
3832
3831
3833
- private var isGroundKnown : Boolean = false
3834
- private var isGroundCache : Boolean = _
3832
+ // Boolean caches: 0 = uninitialized, -1 = false, 1 = true
3833
+ private var myStableHash : Byte = 0
3834
+ private var myGround : Byte = 0
3835
3835
3836
- def isGround (acc : TypeAccumulator [Boolean ])(using Context ): Boolean = {
3837
- if (! isGroundKnown) {
3838
- isGroundCache = acc.foldOver(true , this )
3839
- isGroundKnown = true
3840
- }
3841
- isGroundCache
3842
- }
3836
+ def isGround (acc : TypeAccumulator [Boolean ])(using Context ): Boolean =
3837
+ if myGround == 0 then myGround = if acc.foldOver(true , this ) then 1 else - 1
3838
+ myGround > 0
3843
3839
3844
3840
override def underlying (using Context ): Type = tycon
3845
3841
@@ -5640,7 +5636,7 @@ object Types {
5640
5636
foldOver(cs + tp.typeSymbol, tp)
5641
5637
case tp : TypeRef if tp.info.isTypeAlias =>
5642
5638
apply(cs, tp.superType)
5643
- case tp : TypeRef if tp.typeSymbol .isClass =>
5639
+ case tp : TypeRef if tp.symbol .isClass =>
5644
5640
foldOver(cs + tp.typeSymbol, tp)
5645
5641
case tp : TermRef =>
5646
5642
val tsym = if (tp.termSymbol.is(Param )) tp.underlying.typeSymbol else tp.termSymbol
You can’t perform that action at this time.
0 commit comments