File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
compiler/src/dotty/tools/dotc/typer Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -771,8 +771,9 @@ object Checking {
771
771
! (symBoundary.isContainedIn(otherBoundary) ||
772
772
otherLinkedBoundary.exists && symBoundary.isContainedIn(otherLinkedBoundary))
773
773
}
774
- && ! (inCaptureSet && other.isAllOf(LocalParamAccessor ))
775
- // class parameters in capture sets are not treated as leaked since in
774
+ && ! (inCaptureSet && (! Feature .ccEnabled || other.isAllOf(LocalParamAccessor )))
775
+ // All references are skipped in capture sets when CC is not enabled.
776
+ // Class parameters in capture sets are not treated as leaked since in
776
777
// phase CheckCaptures these are treated as normal vals.
777
778
778
779
def apply (tp : Type ): Type = tp match {
Original file line number Diff line number Diff line change
1
+ import language .experimental .captureChecking
2
+
3
+ class A :
4
+ def f (x : A ^ ): A ^ {this , x} = ???
Original file line number Diff line number Diff line change
1
+ class B :
2
+ private val a : A = ???
3
+ def g (b : A ) = a.f(b)
You can’t perform that action at this time.
0 commit comments