mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The more awkward setup with pushGenericParams()/popGenericParams() is required so that when demangling requirements and field types we get the correct pack-ness for each type parameter. The pack-ness is encoded as part of the generic signature, and not as part of the type parameter mangling itself. Fixes the ASTDemangler issue from rdar://problem/115459973.
15 lines
552 B
Swift
15 lines
552 B
Swift
// RUN: %target-swift-frontend -emit-ir %s -g -module-name closure | %FileCheck %s
|
|
|
|
// CHECK-DAG: !{{[0-9]+}} = !DICompositeType(tag: DW_TAG_structure_type, name: "$sxxQp_QSiIgp_D", {{.*}})
|
|
public func f<each Input>(builder: (repeat each Input) -> ()) {}
|
|
|
|
public protocol P {
|
|
func f() -> Self
|
|
}
|
|
|
|
// CHECK-DAG: !{{[0-9]+}} = !DICompositeType(tag: DW_TAG_structure_type, name: "$sxxQp_tz_xxQp_QP_Rvz7closure1PRzlXXD", {{.*}})
|
|
public func foo<each T: P>(t: repeat each T) -> () -> () {
|
|
var x = (repeat each t)
|
|
return { x = (repeat (each x).f()) }
|
|
}
|