[SR-15745] Actor methods able to be called from escaping closure without await
#58022
Labels
async & await
Feature → concurrency: asynchronous function aka the async/await pattern
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
concurrency
Feature: umbrella label for concurrency language features
diagnostics QoI
Bug: Diagnostics Quality of Implementation
not a bug
Resolution → not a bug: Reported as a bug but turned out to be expected behavior or programmer error
Environment
Additional Detail from JIRA
md5: 581829c2432961ebf61e130142bf32e5
Issue Description:
This compiles, and I'm pretty sure it shouldn't:
The code inside the `@escaping` closure is no longer running inside the actor's context, so it seems like it shouldn't be able to call the actor's methods without an `await`, and that this is therefore a bug.
Forum thread with related discussion: https://forums.swift.org/t/calling-escaping-closure-from-actor-context-why-dont-i-need-await-here/51029
The text was updated successfully, but these errors were encountered: