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] Try harder to downgrade preconcurrency errors to warnings in
Swift 5 mode.
When you annotate a ValueDecl with `@preconcurrency`, the compiler should allow
concurrency violations by downgrading errors in the actor isolation checker to
warnings in Swift 5 mode. Previously, the actor isolation checker only checked
whether the caller's context was preconcurrency when deciding to downgrade, so
referencing preconcurrency declarations directly remained errors. Preconcurrency
was also dropped when computing actor isolation for declarations imported from
clang, which are always preconcurrency.
(cherry picked from commit 57214ce)
Copy file name to clipboardExpand all lines: test/ClangImporter/objc_async.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -210,7 +210,7 @@ class MyButton : NXButton {
210
210
}
211
211
212
212
@SomeGlobalActorfunc testOther(){
213
-
onButtonPress() // expected-error{{call to main actor-isolated instance method 'onButtonPress()' in a synchronous global actor 'SomeGlobalActor'-isolated context}}
213
+
onButtonPress() // expected-warning{{call to main actor-isolated instance method 'onButtonPress()' in a synchronous global actor 'SomeGlobalActor'-isolated context}}
Copy file name to clipboardExpand all lines: test/Concurrency/predates_concurrency.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -97,7 +97,7 @@ func testCalls(x: X) {
97
97
})
98
98
99
99
onMainActorAlways() // okay with minimal/targeted concurrency. Not ok with complete.
100
-
// expected-complete-sns-error @-1 {{call to main actor-isolated global function 'onMainActorAlways()' in a synchronous nonisolated context}}
100
+
// expected-complete-sns-warning @-1 {{call to main actor-isolated global function 'onMainActorAlways()' in a synchronous nonisolated context}}
101
101
102
102
// Ok with minimal/targeted concurrency, Not ok with complete.
103
103
let _:()->Void= onMainActorAlways // expected-complete-sns-warning {{converting function value of type '@MainActor () -> ()' to '() -> Void' loses global actor 'MainActor'}}
0 commit comments