File tree 2 files changed +805
-6
lines changed
compiler/src/dotty/tools/dotc/core
2 files changed +805
-6
lines changed Original file line number Diff line number Diff line change @@ -3701,6 +3701,7 @@ object Types extends TypeUtils {
3701
3701
myUnion
3702
3702
3703
3703
private var atomsRunId : RunId = NoRunId
3704
+ private var widenedRunId : RunId = NoRunId
3704
3705
private var myAtoms : Atoms = uninitialized
3705
3706
private var myWidened : Type = uninitialized
3706
3707
@@ -3716,20 +3717,18 @@ object Types extends TypeUtils {
3716
3717
val tp2w = tp2.widenSingletons()
3717
3718
if ((tp1 eq tp1w) && (tp2 eq tp2w)) this else TypeComparer .lub(tp1w, tp2w, isSoft = isSoft)
3718
3719
3719
- private def ensureAtomsComputed ()( using Context ): Unit =
3720
+ override def atoms ( using Context ): Atoms =
3720
3721
if atomsRunId != ctx.runId then
3721
3722
myAtoms = computeAtoms()
3722
- myWidened = computeWidenSingletons()
3723
3723
if ! isProvisional then atomsRunId = ctx.runId
3724
-
3725
- override def atoms (using Context ): Atoms =
3726
- ensureAtomsComputed()
3727
3724
myAtoms
3728
3725
3729
3726
override def widenSingletons (skipSoftUnions : Boolean )(using Context ): Type =
3730
3727
if isSoft && skipSoftUnions then this
3731
3728
else
3732
- ensureAtomsComputed()
3729
+ if widenedRunId != ctx.runId then
3730
+ myWidened = computeWidenSingletons()
3731
+ if ! isProvisional then widenedRunId = ctx.runId
3733
3732
myWidened
3734
3733
3735
3734
def derivedOrType (tp1 : Type , tp2 : Type , soft : Boolean = isSoft)(using Context ): Type =
You can’t perform that action at this time.
0 commit comments