Skip to content

Commit 1df49f1

Browse files
committed
Make cap a supercapture of local roots
1 parent c2b805a commit 1df49f1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ sealed abstract class CaptureSet extends Showable:
152152
&& ctx.property(LooseRootChecking).isDefined
153153

154154
private def isSuperRootOf(y: CaptureRoot) = x match
155-
case x: CaptureRoot if x.isLocalRootCapability => y.encloses(x)
155+
case x: CaptureRoot =>
156+
x.isGenericRootCapability || x.isLocalRootCapability && y.encloses(x)
156157
case _ => false
157158
end extension
158159

0 commit comments

Comments
 (0)