Skip to content

Commit 37c1775

Browse files
committed
vanish single tuple on lowering verification
1 parent 0bbaa35 commit 37c1775

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/SIL/IR/TypeLowering.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3012,6 +3012,9 @@ bool TypeConverter::visitAggregateLeaves(
30123012
std::optional<unsigned> index;
30133013
std::tie(ty, origTy, field, index) = popFromWorklist();
30143014
assert(!field || !index && "both field and index!?");
3015+
if (auto origEltTy = origTy.getVanishingTupleElementPatternType()) {
3016+
origTy = *origEltTy;
3017+
}
30153018
if (isAggregate(ty) && !isLeafAggregate(ty, origTy, field, index)) {
30163019
if (auto packTy = dyn_cast<SILPackType>(ty)) {
30173020
for (auto packIndex : indices(packTy->getElementTypes())) {

test/IRGen/variadic_generic_types.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ blackHole(G<Int, String>.self)
3131
let g = G<Int, String, Float>()
3232
blackHole(g.makeTuple1())
3333
blackHole(g.makeTuple2())
34+
35+
struct VariadicOptionalTuple<each V> {
36+
var v: (repeat (each V)?)
37+
}
38+
39+
func useVOT(_: VariadicOptionalTuple<String>) {}

0 commit comments

Comments
 (0)