Files
swift-mirror/test/DebugInfo/variadic-generics-closure.swift
Slava Pestov 57b702be07 ASTDemangler: Fix round-tripping of SILBoxTypeWithLayout
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.
2023-09-22 11:27:18 -04:00

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()) }
}