Inconsistent isolation of top-level closure #81599
8000
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
It seems that a top-level closure without attributes is interpreted as both
@MainActor
and non-@MainActor
.Reproduction
See also: https://forums.swift.org/t/why-can-a-sendable-closure-call-a-non-sendable-closure/79921
Expected behavior
The given code compiles (even in language mode 6) although it should not.
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1.2 (swiftlang-6.1.2.1.2 clang-1700.0.13.5)
Target: arm64-apple-macosx15.0
Additional information
No response
The text was updated successfully, but these errors were encountered: