-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
SILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stageactor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationcompilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresswift 6.2unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output
Description
Description
No response
Reproduction
nonisolated(nonsending) func g() async {
MainActor.assertIsolated()
}
nonisolated(nonsending)
func f() async {
await g() // okay
let closure = g
await closure() // boom
}
@main struct Foo {
static func main() async throws {
await f()
}
}
Expected behavior
g
does not switch off the main actor.
Environment
Apple Swift version 6.2 (swiftlang-6.2.0.19.8 clang-1700.3.19.1)
Additional information
No response
Metadata
Metadata
Assignees
Labels
SILGenArea → compiler: The SIL generation stageArea → compiler: The SIL generation stageactor isolationFeature → concurrency: Actor isolationFeature → concurrency: Actor isolationcompilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresswift 6.2unexpected behaviorBug: Unexpected behavior or incorrect outputBug: Unexpected behavior or incorrect output