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 @@ -7459,7 +7459,7 @@ void AttributeChecker::visitNonisolatedAttr(NonisolatedAttr *attr) {
7459
7459
}
7460
7460
7461
7461
if (var->getAttrs ().hasAttribute <LazyAttr>()) {
7462
- diagnoseAndRemoveAttr (attr, diag::nonisolated_lazy)
7462
+ diagnose (attr-> getLocation () , diag::nonisolated_lazy)
7463
7463
.warnUntilSwiftVersion (6 );
7464
7464
return ;
7465
7465
}
Original file line number Diff line number Diff line change @@ -838,11 +838,13 @@ actor LazyActor {
838
838
// expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
839
839
nonisolated lazy var l32 : Int = v
840
840
// 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}}
841
842
nonisolated lazy var l33 : Int = { self . v } ( )
842
843
// expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
843
844
// expected-warning@-2 {{actor-isolated default value in a nonisolated context; this is an error in the Swift 6 language mode}}
844
845
nonisolated lazy var l34 : Int = self . v
845
846
// 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}}
846
848
nonisolated lazy var l35 : Int = { [ unowned self] in self . v } ( )
847
849
// expected-warning@-1 {{'nonisolated' is not supported on lazy properties; this is an error in the Swift 6 language mode}}
848
850
// 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 {
64
64
65
65
// makes sure the synthesized init's delegation kind is determined correctly.
66
66
actor 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