You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Concurrency] Fix disallowed override isolation to carry @preconcurrency bit
If ObjC member cannot be overridden due to isolation mismatch set `@preconcurrency`
bit to make the diagnostic a warning instead of an error in Swift 5 mode.
Resolves: rdar://130776220
Such declarations don't have an explicit attribute to indicate that they
are `@preconcurrency` but default isolation as determined by `ActorIsolationRequest`
should mark them as such regardless.
Resolves: rdar://130776220
Copy file name to clipboardExpand all lines: test/ClangImporter/objc_isolation_complete.swift
+13Lines changed: 13 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -31,3 +31,16 @@ class IsolatedSub: NXSender {
31
31
return mainActorState
32
32
}
33
33
}
34
+
35
+
@objc
36
+
@MainActor
37
+
classTest:NSObject{
38
+
staticvarshared:Test? // expected-note {{mutation of this static property is only permitted within the actor}}
39
+
40
+
overrideinit(){
41
+
super.init()
42
+
43
+
Self.shared =self
44
+
// expected-warning@-1 {{main actor-isolated static property 'shared' can not be mutated from a nonisolated context; this is an error in the Swift 6 language mode}}
0 commit comments