|
1 | 1 | // RUN: %empty-directory(%t) |
2 | 2 |
|
3 | | -// RUN: %target-swift-frontend -emit-module -emit-module-path %t/other_global_actor_inference.swiftmodule -module-name other_global_actor_inference -strict-concurrency=complete %S/Inputs/other_global_actor_inference.swift |
4 | | -// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -verify-additional-prefix minimal-targeted- |
5 | | -// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted -verify-additional-prefix minimal-targeted- |
6 | | -// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -verify-additional-prefix complete-tns- |
7 | | -// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -enable-upcoming-feature RegionBasedIsolation -verify-additional-prefix complete-tns- |
| 3 | +// RUN: %target-swift-frontend -emit-module -emit-module-path %t/other_global_actor_inference.swiftmodule -module-name other_global_actor_inference -strict-concurrency=complete %S/Inputs/other_global_actor_inference.swift -enable-experimental-feature GlobalActorIsolatedTypesUsability |
| 4 | +// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -verify-additional-prefix minimal-targeted- -enable-experimental-feature GlobalActorIsolatedTypesUsability |
| 5 | +// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=targeted -verify-additional-prefix minimal-targeted- -enable-experimental-feature GlobalActorIsolatedTypesUsability |
| 6 | +// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -verify-additional-prefix complete-tns- -enable-experimental-feature GlobalActorIsolatedTypesUsability |
| 7 | +// RUN: %target-swift-frontend -I %t -disable-availability-checking %s -emit-sil -o /dev/null -verify -strict-concurrency=complete -enable-upcoming-feature RegionBasedIsolation -verify-additional-prefix complete-tns- -enable-experimental-feature GlobalActorIsolatedTypesUsability |
8 | 8 |
|
9 | 9 | // REQUIRES: concurrency |
10 | 10 | // REQUIRES: asserts |
@@ -285,14 +285,14 @@ func barSync() { |
285 | 285 |
|
286 | 286 | @OtherGlobalActor |
287 | 287 | struct Observed { |
288 | | - var thing: Int = 0 { // expected-note {{property declared here}} |
| 288 | + var thing: Int = 0 { |
289 | 289 | didSet {} |
290 | 290 | willSet {} |
291 | 291 | } |
292 | 292 | } |
293 | 293 |
|
294 | | -func checkObserved(_ o: Observed) { // expected-note {{add '@OtherGlobalActor' to make global function 'checkObserved' part of global actor 'OtherGlobalActor'}} |
295 | | - _ = o.thing // expected-error {{global actor 'OtherGlobalActor'-isolated property 'thing' can not be referenced from a non-isolated context}} |
| 294 | +func checkObserved(_ o: Observed) { |
| 295 | + _ = o.thing // okay |
296 | 296 | } |
297 | 297 |
|
298 | 298 | // ---------------------------------------------------------------------- |
@@ -376,13 +376,13 @@ actor WrapperActor<Wrapped: Sendable> { |
376 | 376 |
|
377 | 377 | struct HasWrapperOnActor { |
378 | 378 | @WrapperOnActor var synced: Int = 0 |
379 | | - // expected-note@-1 3{{property declared here}} |
| 379 | + // expected-note@-1 2{{property declared here}} |
380 | 380 |
|
381 | | - // expected-note@+1 3{{to make instance method 'testErrors()'}} |
| 381 | + // expected-note@+1 2{{to make instance method 'testErrors()'}} |
382 | 382 | func testErrors() { |
383 | 383 | _ = synced // expected-error{{main actor-isolated property 'synced' can not be referenced from a non-isolated context}} |
384 | 384 | _ = $synced // expected-error{{global actor 'SomeGlobalActor'-isolated property '$synced' can not be referenced from a non-isolated context}} |
385 | | - _ = _synced // expected-error{{global actor 'OtherGlobalActor'-isolated property '_synced' can not be referenced from a non-isolated context}} |
| 385 | + _ = _synced // okay |
386 | 386 | } |
387 | 387 |
|
388 | 388 | @MainActor mutating func testOnMain() { |
@@ -566,22 +566,21 @@ struct HasWrapperOnUnsafeActor { |
566 | 566 | // expected-complete-tns-warning@-2 {{default initializer for 'HasWrapperOnUnsafeActor' cannot be both nonisolated and global actor 'OtherGlobalActor'-isolated; this is an error in the Swift 6 language mode}} |
567 | 567 |
|
568 | 568 | @WrapperOnUnsafeActor var synced: Int = 0 // expected-complete-tns-note 2 {{initializer for property '_synced' is global actor 'OtherGlobalActor'-isolated}} |
569 | | - // expected-note @-1 3{{property declared here}} |
570 | | - // expected-complete-tns-note @-2 3{{property declared here}} |
| 569 | + // expected-note @-1 2{{property declared here}} |
| 570 | + // expected-complete-tns-note @-2 2{{property declared here}} |
571 | 571 |
|
572 | 572 | func testUnsafeOkay() { |
573 | | - // expected-complete-tns-note @-1 {{add '@OtherGlobalActor' to make instance method 'testUnsafeOkay()' part of global actor 'OtherGlobalActor'}} |
574 | | - // expected-complete-tns-note @-2 {{add '@SomeGlobalActor' to make instance method 'testUnsafeOkay()' part of global actor 'SomeGlobalActor'}} |
575 | | - // expected-complete-tns-note @-3 {{add '@MainActor' to make instance method 'testUnsafeOkay()' part of global actor 'MainActor'}} |
| 573 | + // expected-complete-tns-note @-1 {{add '@SomeGlobalActor' to make instance method 'testUnsafeOkay()' part of global actor 'SomeGlobalActor'}} |
| 574 | + // expected-complete-tns-note @-2 {{add '@MainActor' to make instance method 'testUnsafeOkay()' part of global actor 'MainActor'}} |
576 | 575 | _ = synced // expected-complete-tns-warning {{main actor-isolated property 'synced' can not be referenced from a non-isolated context}} |
577 | 576 | _ = $synced // expected-complete-tns-warning {{global actor 'SomeGlobalActor'-isolated property '$synced' can not be referenced from a non-isolated context}} |
578 | | - _ = _synced // expected-complete-tns-warning {{global actor 'OtherGlobalActor'-isolated property '_synced' can not be referenced from a non-isolated context}} |
| 577 | + _ = _synced // okay |
579 | 578 | } |
580 | 579 |
|
581 | 580 | nonisolated func testErrors() { |
582 | 581 | _ = synced // expected-warning{{main actor-isolated property 'synced' can not be referenced from a non-isolated context}} |
583 | 582 | _ = $synced // expected-warning{{global actor 'SomeGlobalActor'-isolated property '$synced' can not be referenced from a non-isolated context}} |
584 | | - _ = _synced // expected-warning{{global actor 'OtherGlobalActor'-isolated property '_synced' can not be referenced from a non-isolated context}} |
| 583 | + _ = _synced // okay |
585 | 584 | } |
586 | 585 |
|
587 | 586 | @MainActor mutating func testOnMain() { |
|
0 commit comments