'any Sendable' is ignored in function type conversions #81888
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Uh oh!
There was an error while loading. Please reload this page.
Description
A function type involving
any Sendable
are treated as if it wereAny
. This allows function type conversions that is concurrency-unsafe. For example,() -> Any
can be converted to() -> any Sendable
, and(any Sendable) -> Void
can be converted to(Any) -> Void
.Reproduction
Expected behavior
All three functions above should produce a compile time error.
Environment
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx15.0
Also reproducible on 6.1.2 on SwiftFiddle.
Additional information
From a Stack Overflow post.
The text was updated successfully, but these errors were encountered: