Skip to content

Commit b03d921

Browse files
committed
Make sure chained actor accesses emit an error for each uncovered lookup.
Each individual lookup is async since they're actor instances.
1 parent 0c675c7 commit b03d921

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

test/Concurrency/actor_call_implicitly_async.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,16 @@ func blender(_ peeler : () -> Void) {
203203
await (true ? wisk : {n in return})(1)
204204
}
205205

206+
actor Chain {
207+
var next : Chain?
208+
}
209+
210+
func walkChain(chain : Chain) async {
211+
_ = chain.next?.next?.next?.next // expected-error 4 {{property access is 'async' but is not marked with 'await'}}
212+
_ = (await chain.next)?.next?.next?.next // expected-error 3 {{property access is 'async' but is not marked with 'await'}}
213+
_ = (await chain.next?.next)?.next?.next // expected-error 2 {{property access is 'async' but is not marked with 'await'}}
214+
}
215+
206216

207217
// want to make sure there is no note about implicitly async on this func.
208218
@BananaActor func rice() async {}

0 commit comments

Comments
 (0)