mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
12 lines
291 B
Swift
12 lines
291 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
|
|
public struct G<T> {
|
|
var value: T { fatalError() }
|
|
}
|
|
|
|
public func f<T>(transform: () -> T) {}
|
|
|
|
public func g<T, each V>(_ v: repeat G<each V>?, transform: (repeat (each V)?) -> T) {
|
|
f(transform: { transform(repeat (each v)?.value ?? nil) })
|
|
}
|