Skip to content

Commit caec7a5

Browse files
committed
Fix isEmpty condition in well-formedness check
1 parent be073b1 commit caec7a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ object CheckCaptures:
6363
def checkWellformedPost(tp: Type, pos: SrcPos)(using Context): Unit = tp match
6464
case CapturingType(parent, refs, _) =>
6565
for ref <- refs.elems do
66-
if ref.captureSet.subCaptures(CaptureSet.empty, frozen = true) == CompareResult.OK then
66+
if ref.captureSetOfInfo.elems.isEmpty then
6767
report.error(em"$ref cannot be tracked since its capture set is empty", pos)
6868
else if parent.captureSet.accountsFor(ref) then
6969
report.warning(em"redundant capture: $parent already accounts for $ref", pos)

0 commit comments

Comments
 (0)