|
8 | 8 |
|
9 | 9 | @available(SwiftStdlib 5.1, *)
|
10 | 10 | actor A {
|
11 |
| - func f() { } // expected-typechecker-note 5{{calls to instance method 'f()' from outside of its actor context are implicitly asynchronous}} |
| 11 | + func f() { } // expected-typechecker-note 3{{calls to instance method 'f()' from outside of its actor context are implicitly asynchronous}} |
12 | 12 | }
|
13 | 13 |
|
14 | 14 | @available(SwiftStdlib 5.1, *)
|
@@ -364,11 +364,8 @@ func isolatedClosures() {
|
364 | 364 | // expected-typechecker-warning@+2 {{cannot have more than one 'isolated' parameter; this is an error in the Swift 6 language mode}}
|
365 | 365 | // expected-typechecker-warning@+1 {{subscript with 'isolated' parameter cannot be 'nonisolated'; this is an error in the Swift 6 language mode}}{{3-15=}}
|
366 | 366 | nonisolated subscript(_ a: isolated A, _ b: isolated A) -> Int {
|
367 |
| - // FIXME: wrong isolation. should be isolated to `a`. |
368 |
| - #if ALLOW_TYPECHECKER_ERRORS |
369 |
| - a.f() // expected-typechecker-error {{call to actor-isolated instance method 'f()' in a synchronous actor-isolated context}} |
370 |
| - b.f() // expected-typechecker-error {{call to actor-isolated instance method 'f()' in a synchronous actor-isolated context}} |
371 |
| - #endif |
| 367 | + a.f() |
| 368 | + b.f() |
372 | 369 | return 0
|
373 | 370 | }
|
374 | 371 |
|
@@ -591,3 +588,14 @@ public actor MyActorIsolatedParameterMerge {
|
591 | 588 | class ClassWithIsolatedAsyncInitializer {
|
592 | 589 | init(isolation: isolated (any Actor)? = #isolation) async {}
|
593 | 590 | }
|
| 591 | + |
| 592 | +// https://github.com/swiftlang/swift/issues/80992 |
| 593 | +struct WritableActorKeyPath<Root: Actor, Value>: Sendable { |
| 594 | + var getter: @Sendable (isolated Root) -> Value |
| 595 | + var setter: @Sendable (isolated Root, Value) -> Void |
| 596 | + |
| 597 | + subscript(_ root: isolated Root) -> Value { |
| 598 | + get { getter(root) } |
| 599 | + nonmutating set { setter(root, newValue) } |
| 600 | + } |
| 601 | +} |
0 commit comments