Skip to content

Commit 6944aa0

Browse files
committed
Fix "Cache captureSets of CaptureRefs only at phase cc"
1 parent 349e113 commit 6944aa0

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

compiler/src/dotty/tools/dotc/core/Types.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,14 +2052,13 @@ object Types {
20522052

20532053
def captureSetOfInfo(using Context): CaptureSet =
20542054
if ctx.runId == myCaptureSetRunId then myCaptureSet
2055-
else if (myCaptureSet eq CaptureSet.Pending)
2056-
|| ctx.phase != Phases.checkCapturesPhase then CaptureSet.empty
2055+
else if myCaptureSet eq CaptureSet.Pending then CaptureSet.empty
20572056
else
20582057
myCaptureSet = CaptureSet.Pending
20592058
val computed =
20602059
if isRootCapability then singletonCaptureSet
20612060
else CaptureSet.ofType(underlying)
2062-
if underlying.isProvisional then
2061+
if ctx.phase != Phases.checkCapturesPhase || underlying.isProvisional then
20632062
myCaptureSet = null
20642063
else
20652064
myCaptureSet = computed

0 commit comments

Comments
 (0)