File tree Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Expand file tree Collapse file tree 3 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -7273,7 +7273,7 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
72737273 }
72747274
72757275 if (var->getAttrs ().hasAttribute <LazyAttr>()) {
7276- diagnoseAndRemoveAttr (attr, diag::nonisolated_lazy)
7276+ diagnose (attr-> getLocation () , diag::nonisolated_lazy)
72777277 .warnUntilSwiftVersion (6 );
72787278 return ;
72797279 }
Original file line number Diff line number Diff line change @@ -838,11 +838,13 @@ actor LazyActor {
838838 // expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
839839 nonisolated lazy var l32 : Int = v
840840 // expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
841+ // expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
841842 nonisolated lazy var l33 : Int = { self . v } ( )
842843 // expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
843844 // expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
844845 nonisolated lazy var l34 : Int = self . v
845846 // expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
847+ // expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
846848 nonisolated lazy var l35 : Int = { [ unowned self] in self . v } ( )
847849 // expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
848850 // expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
Original file line number Diff line number Diff line change @@ -64,3 +64,8 @@ actor Dril: NSObject {
6464
6565// makes sure the synthesized init's delegation kind is determined correctly.
6666actor Pumpkin : NSObject { }
67+
68+ actor Bad {
69+ @objc nonisolated lazy var invalid = 0
70+ // expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
71+ }
You can’t perform that action at this time.
0 commit comments