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
Copy file name to clipboardExpand all lines: test/Concurrency/attr_execution_conversions.swift
+56Lines changed: 56 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,3 +77,59 @@ do {
77
77
// expected-error@-1 {{cannot convert value of type '(@execution(caller) () async -> ()).Type' to expected argument type '(@isolated(any) () async -> Void).Type'}}
let _:@execution(caller)(NonSendable)async->Void= globalActor1 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
97
+
// expected-error@-1 {{cannot convert '@MainActor @Sendable (NonSendable) async -> Void' to '@execution(caller) (NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
98
+
let _:@execution(caller)()async->NonSendable= globalActor2 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
99
+
// expected-error@-1 {{cannot convert '@MainActor @Sendable () async -> NonSendable' to '@execution(caller) () async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
100
+
101
+
let _:@execution(caller)(NonSendable)async->Void= erased1 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
102
+
// expected-error@-1 {{cannot convert '@isolated(any) @Sendable (NonSendable) async -> Void' to '@execution(caller) (NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
103
+
let _:@execution(caller)()async->NonSendable= erased2 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
104
+
// expected-error@-1 {{cannot convert '@isolated(any) @Sendable () async -> NonSendable' to '@execution(caller) () async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
105
+
106
+
let _:@execution(caller)(NonSendable)async->Void= nonIsolated1 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
107
+
// expected-error@-1 {{annot convert '@Sendable (NonSendable) -> Void' to '@execution(caller) (NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
108
+
let _:@execution(caller)(NonSendable)async->Void= nonIsolated2 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
109
+
// expected-error@-1 {{cannot convert '@Sendable (NonSendable) async -> Void' to '@execution(caller) (NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
110
+
111
+
let _:@execution(caller)()async->NonSendable= nonIsolated3 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
112
+
// expected-error@-1 {{cannot convert '@Sendable () -> NonSendable' to '@execution(caller) () async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
113
+
let _:@execution(caller)()async->NonSendable= nonIsolated4 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
114
+
// expected-error@-1 {{cannot convert '@Sendable () async -> NonSendable' to '@execution(caller) () async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
115
+
116
+
let _:@execution(concurrent)(NonSendable)async->Void= erased1 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
117
+
// expected-warning@-1 {{cannot convert '@isolated(any) @Sendable (NonSendable) async -> Void' to '(NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
118
+
let _:@execution(concurrent)()async->NonSendable= erased2 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
119
+
// expected-warning@-1 {{cannot convert '@isolated(any) @Sendable () async -> NonSendable' to '() async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
120
+
121
+
122
+
let _:@execution(concurrent)(NonSendable)async->Void= caller1 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
123
+
// expected-warning@-1 {{cannot convert '@execution(caller) @Sendable (NonSendable) async -> Void' to '(NonSendable) async -> Void' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
124
+
let _:@execution(concurrent)()async->NonSendable= caller2 // expected-note {{type 'NonSendable' does not conform to 'Sendable' protocol}}
125
+
// expected-warning@-1 {{cannot convert '@execution(caller) @Sendable () async -> NonSendable' to '() async -> NonSendable' because crossing of an isolation boundary requires parameter and result types to conform to 'Sendable' protocol}}
126
+
127
+
let _:@MainActor(NonSendable)async->Void= nonIsolated1 // Ok
128
+
let _:@MainActor(NonSendable)async->Void= nonIsolated2 // Ok
129
+
130
+
let _:@MainActor()async->NonSendable= nonIsolated3 // Ok
131
+
let _:@MainActor()async->NonSendable= nonIsolated4 // Ok
132
+
133
+
let _:@MainActor(NonSendable)async->Void= caller1 // Ok
134
+
let _:@MainActor()async->NonSendable= caller2 // Ok
0 commit comments