mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
16 lines
414 B
Swift
16 lines
414 B
Swift
// RUN: %target-swift-frontend -emit-ir -g %s -swift-version 6 -enable-upcoming-feature NonisolatedNonsendingByDefault
|
|
// REQUIRES: swift_feature_NonisolatedNonsendingByDefault
|
|
|
|
public protocol P: Sendable {
|
|
func f(_: Int) async
|
|
}
|
|
|
|
public struct S: Sendable {
|
|
public func f(p: [any P]) async {
|
|
let x: [@Sendable (Int) async -> ()] = p.map { $0.f }
|
|
|
|
// FIXME: crashes
|
|
//let y = p.map { $0.f }
|
|
}
|
|
}
|