Skip to content

Commit c9a02c8

Browse files
committed
Restrict isUncachable
1 parent 09f00bb commit c9a02c8

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

compiler/src/dotty/tools/dotc/cc/CapturingType.scala

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,10 @@ object CapturingType:
7777
None
7878

7979
/** Check whether a type is uncachable when computing `baseType`.
80-
* - Avoid caching all the types during the setup phase, since at that point
81-
* the capture set variables are not fully installed yet.
82-
* - Avoid caching capturing types when IgnoreCaptures mode is set, since the
83-
* capture sets may be thrown away in the computed base type.
84-
*/
80+
* We avoid caching capturing types when IgnoreCaptures mode is set, since the
81+
*/
8582
def isUncachable(tp: Type)(using Context): Boolean =
86-
ctx.phase == Phases.checkCapturesPhase
87-
&& (Setup.isDuringSetup
88-
|| ctx.mode.is(Mode.IgnoreCaptures) && decomposeCapturingType(tp).isDefined)
83+
ctx.mode.is(Mode.IgnoreCaptures) && decomposeCapturingType(tp).isDefined
8984

9085
end CapturingType
9186

0 commit comments

Comments
 (0)