Open
Description
Description
Using of ~Copyable type with async let causes compiler error
Reproduction
struct NonCopyable: ~Copyable {}
struct Pair: ~Copyable {
let first: NonCopyable
let second: NonCopyable
}
@Sendable func request() async -> NonCopyable { NonCopyable() }
async let first = request()
async let second = request()
let outputs = await Pair(first: first, second: second) // ERROR: Copy of noncopyable typed value. This is a compiler bug. Please file a bug with a small example of the bug
Expected behavior
Compiler don't ask me to file a bug.
Environment
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
XCode 16.3
Additional information
No response
Metadata
Metadata
Assignees
Labels
Feature → concurrency: asynchronous function aka the async/await patternA deviation from expected or documented behavior. Also: expected but undesirable behavior.The Swift compiler itselfFeature: umbrella label for concurrency language featuresFeature → declarations: Noncopyable value type declarations