-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels
Description
Description
Inference system broke after enabling SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES
Reproduction
Code like:
enum ImageName {
case one
case two
}
func test(_ arr: [Int]) -> ImageName {
arr.map { _ in .one }.first!
}can be inferred correctly before enabling the flag, but will throw an error after enabling it.
More discussion: https://forums.swift.org/t/question-about-swift-upcoming-feature-infer-sendable-from-captures/82761/6
Expected behavior
This code compiles correctly when the flag is enabled.
Environment
swift-driver version: 1.127.14.1 Apple Swift version 6.2 (swiftlang-6.2.0.19.9 clang-1700.3.19.1)
Target: arm64-apple-macosx15.0
Additional information
No response
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.triage neededThis issue needs more specific labelsThis issue needs more specific labels