20
20
// Note: intentionally importing Alpha implicitly
21
21
import Beta
22
22
23
+ @globalActor final actor AnotherActor {
24
+ static let shared = AnotherActor ( )
25
+ }
26
+
23
27
@MainActor
24
28
func isolatedFunc( ) { } // expected-note 3{{calls to global function 'isolatedFunc()' from outside of its actor context are implicitly asynchronous}}
25
29
@@ -181,8 +185,8 @@ class ProbeExplicit_DerivedIsolatedClass: DerivedIsolatedClass {
181
185
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeImplicit_BaseIsolatedDealloc : BaseIsolatedDealloc {
182
186
// CHECK: @objc @MainActor @preconcurrency deinit
183
187
// CHECK: }
184
- // CHECK-SYMB: // ProbeImplicit_BaseIsolatedDealloc.__isolated_deallocating_deinit
185
- // CHECK-SYMB: sil private [ossa] @$s4test33ProbeImplicit_BaseIsolatedDeallocCfZ : $@convention(thin) (@owned ProbeImplicit_BaseIsolatedDealloc) -> () {
188
+ // CHECK-SYMB-NOT: ProbeImplicit_BaseIsolatedDealloc.__isolated_deallocating_deinit
189
+ // CHECK-SYMB-NOT: @$s4test33ProbeImplicit_BaseIsolatedDeallocCfZ
186
190
// CHECK-SYMB: // ProbeImplicit_BaseIsolatedDealloc.__deallocating_deinit
187
191
// CHECK-SYMB-NEXT: // Isolation: nonisolated
188
192
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test33ProbeImplicit_BaseIsolatedDeallocCfD : $@convention(method) (@owned ProbeImplicit_BaseIsolatedDealloc) -> () {
@@ -191,9 +195,8 @@ class ProbeImplicit_BaseIsolatedDealloc: BaseIsolatedDealloc {}
191
195
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeExplicit_BaseIsolatedDealloc : BaseIsolatedDealloc {
192
196
// CHECK: @objc deinit
193
197
// CHECK: }
194
- // CHECK-SYMB: // ProbeExplicit_BaseIsolatedDealloc.__isolated_deallocating_deinit
195
- // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor
196
- // CHECK-SYMB-NEXT: sil private [ossa] @$s4test33ProbeExplicit_BaseIsolatedDeallocCfZ : $@convention(thin) (@owned ProbeExplicit_BaseIsolatedDealloc) -> () {
198
+ // CHECK-SYMB-NOT: ProbeExplicit_BaseIsolatedDealloc.__isolated_deallocating_deinit
199
+ // CHECK-SYMB-NOT: @$s4test33ProbeExplicit_BaseIsolatedDeallocCfZ
197
200
// CHECK-SYMB: // ProbeExplicit_BaseIsolatedDealloc.__deallocating_deinit
198
201
// CHECK-SYMB-NEXT: // Isolation: nonisolated
199
202
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test33ProbeExplicit_BaseIsolatedDeallocCfD : $@convention(method) (@owned ProbeExplicit_BaseIsolatedDealloc) -> () {
@@ -203,12 +206,17 @@ class ProbeExplicit_BaseIsolatedDealloc: BaseIsolatedDealloc {
203
206
}
204
207
}
205
208
209
+ #if !SILGEN
210
+ class ProbeAnother_BaseIsolatedDealloc : BaseIsolatedDealloc {
211
+ @AnotherActor deinit { } // expected-error {{global actor 'AnotherActor'-isolated deinitializer 'deinit' has different actor isolation from main actor-isolated overridden declaration}}
212
+ }
213
+ #endif
214
+
206
215
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeImplicit_DerivedIsolatedDealloc : DerivedIsolatedDealloc {
207
216
// CHECK: @objc @MainActor @preconcurrency deinit
208
217
// CHECK: }
209
- // CHECK-SYMB: // ProbeImplicit_DerivedIsolatedDealloc.__isolated_deallocating_deinit
210
- // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor
211
- // CHECK-SYMB: sil private [ossa] @$s4test36ProbeImplicit_DerivedIsolatedDeallocCfZ : $@convention(thin) (@owned ProbeImplicit_DerivedIsolatedDealloc) -> () {
218
+ // CHECK-SYMB-NOT: ProbeImplicit_DerivedIsolatedDealloc.__isolated_deallocating_deinit
219
+ // CHECK-SYMB-NOT: @$s4test36ProbeImplicit_DerivedIsolatedDeallocCfZ
212
220
// CHECK-SYMB: // ProbeImplicit_DerivedIsolatedDealloc.__deallocating_deinit
213
221
// CHECK-SYMB-NEXT: // Isolation: nonisolated
214
222
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test36ProbeImplicit_DerivedIsolatedDeallocCfD : $@convention(method) (@owned ProbeImplicit_DerivedIsolatedDealloc) -> () {
@@ -217,9 +225,8 @@ class ProbeImplicit_DerivedIsolatedDealloc: DerivedIsolatedDealloc {}
217
225
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeExplicit_DerivedIsolatedDealloc : DerivedIsolatedDealloc {
218
226
// CHECK: @objc deinit
219
227
// CHECK: }
220
- // CHECK-SYMB: // ProbeExplicit_DerivedIsolatedDealloc.__isolated_deallocating_deinit
221
- // CHECK-SYMB-NEXT: // Isolation: global_actor. type: MainActor
222
- // CHECK-SYMB-NEXT: sil private [ossa] @$s4test36ProbeExplicit_DerivedIsolatedDeallocCfZ : $@convention(thin) (@owned ProbeExplicit_DerivedIsolatedDealloc) -> () {
228
+ // CHECK-SYMB-NOT: ProbeExplicit_DerivedIsolatedDealloc.__isolated_deallocating_deinit
229
+ // CHECK-SYMB-NOT: @$s4test36ProbeExplicit_DerivedIsolatedDeallocCfZ
223
230
// CHECK-SYMB: // ProbeExplicit_DerivedIsolatedDealloc.__deallocating_deinit
224
231
// CHECK-SYMB-NEXT: // Isolation: nonisolated
225
232
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test36ProbeExplicit_DerivedIsolatedDeallocCfD : $@convention(method) (@owned ProbeExplicit_DerivedIsolatedDealloc) -> () {
@@ -229,6 +236,12 @@ class ProbeExplicit_DerivedIsolatedDealloc: DerivedIsolatedDealloc {
229
236
}
230
237
}
231
238
239
+ #if !SILGEN
240
+ class ProbeAnother_DerivedIsolatedDealloc : DerivedIsolatedDealloc {
241
+ @AnotherActor deinit { } // expected-error {{global actor 'AnotherActor'-isolated deinitializer 'deinit' has different actor isolation from main actor-isolated overridden declaration}}
242
+ }
243
+ #endif
244
+
232
245
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeImplicit_DeallocIsolatedFromProtocol : DeallocIsolatedFromProtocol {
233
246
// CHECK: @objc deinit
234
247
// CHECK: }
@@ -239,6 +252,10 @@ class ProbeExplicit_DerivedIsolatedDealloc: DerivedIsolatedDealloc {
239
252
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test41ProbeImplicit_DeallocIsolatedFromProtocolCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromProtocol) -> () {
240
253
class ProbeImplicit_DeallocIsolatedFromProtocol : DeallocIsolatedFromProtocol { }
241
254
255
+ class ProbeAnother_DeallocIsolatedFromProtocol : DeallocIsolatedFromProtocol {
256
+ @AnotherActor deinit { } // ok, base is not isolated
257
+ }
258
+
242
259
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeImplicit_DeallocIsolatedFromCategory : DeallocIsolatedFromCategory {
243
260
// CHECK: @objc deinit
244
261
// CHECK: }
@@ -249,6 +266,10 @@ class ProbeImplicit_DeallocIsolatedFromProtocol: DeallocIsolatedFromProtocol {}
249
266
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test41ProbeImplicit_DeallocIsolatedFromCategoryCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromCategory) -> () {
250
267
class ProbeImplicit_DeallocIsolatedFromCategory : DeallocIsolatedFromCategory { }
251
268
269
+ class ProbeAnother_DeallocIsolatedFromCategory : DeallocIsolatedFromCategory {
270
+ @AnotherActor deinit { } // ok, base is not isolated
271
+ }
272
+
252
273
// CHECK-LABEL: @objc @_inheritsConvenienceInitializers class ProbeImplicit_DeallocIsolatedFromExtension : DeallocIsolatedFromExtension {
253
274
// CHECK: @objc deinit
254
275
// CHECK: }
@@ -258,3 +279,7 @@ class ProbeImplicit_DeallocIsolatedFromCategory: DeallocIsolatedFromCategory {}
258
279
// CHECK-SYMB-NEXT: // Isolation: nonisolated
259
280
// CHECK-SYMB-NEXT: sil hidden [ossa] @$s4test42ProbeImplicit_DeallocIsolatedFromExtensionCfD : $@convention(method) (@owned ProbeImplicit_DeallocIsolatedFromExtension) -> () {
260
281
class ProbeImplicit_DeallocIsolatedFromExtension : DeallocIsolatedFromExtension { }
282
+
283
+ class ProbeAnother_DeallocIsolatedFromExtension : DeallocIsolatedFromExtension {
284
+ @AnotherActor deinit { } // ok, base is not isolated
285
+ }
0 commit comments