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
[ConstraintSystem] Update closure inference to support @execution(...) attribute
- Update `ClosureEffectsRequest` to make sure that closure is
marked as `async` when `@execution(...)` attribute is present.
- Update `inferClosureType` to set isolation based on an explicit
`@execution(...)` attribute attached to a closure.
Copy file name to clipboardExpand all lines: test/Concurrency/attr_execution_conversions.swift
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -82,6 +82,17 @@ do {
82
82
// expected-error@-1 {{cannot convert value of type '(@execution(caller) () async -> ()).Type' to expected argument type '(@isolated(any) () async -> Void).Type'}}
83
83
}
84
84
85
+
do{
86
+
let _:()->Void={@execution(concurrent)in
87
+
// expected-error@-1 {{invalid conversion from 'async' function of type '() async -> Void' to synchronous function type '() -> Void'}}
88
+
}
89
+
90
+
func test(_:()->Void){}
91
+
92
+
test{@execution(caller)in
93
+
// expected-error@-1 {{cannot pass function of type '@execution(caller) () async -> ()' to parameter expecting synchronous function type}}
0 commit comments