Skip to content

Commit 1d8ce4d

Browse files
committed
Slight generalization of needsRecompute
1 parent 1b7868c commit 1d8ce4d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,9 +261,8 @@ class CheckCaptures extends Recheck, SymTransformer:
261261
override def needsRecompute(tp: NamedType, lastDenotation: SingleDenotation)(using Context): Boolean =
262262
tp.prefix match
263263
case prefix: TermRef =>
264-
prefix.info match
265-
case CapturingType(_, _) => true
266-
case _ => !lastDenotation.isInstanceOf[SymDenotation]
264+
!lastDenotation.isInstanceOf[SymDenotation]
265+
|| !prefix.info.captureSet.isAlwaysEmpty
267266
case prefix: SingletonType =>
268267
!lastDenotation.isInstanceOf[SymDenotation]
269268
case _ =>

0 commit comments

Comments
 (0)