vanish single tuple on lowering verification

This commit is contained in:
omochimetaru
2024-12-17 10:43:21 +09:00
parent 0bbaa3519b
commit 37c1775b78
2 changed files with 9 additions and 0 deletions

View File

@@ -3012,6 +3012,9 @@ bool TypeConverter::visitAggregateLeaves(
std::optional<unsigned> index; std::optional<unsigned> index;
std::tie(ty, origTy, field, index) = popFromWorklist(); std::tie(ty, origTy, field, index) = popFromWorklist();
assert(!field || !index && "both field and index!?"); assert(!field || !index && "both field and index!?");
if (auto origEltTy = origTy.getVanishingTupleElementPatternType()) {
origTy = *origEltTy;
}
if (isAggregate(ty) && !isLeafAggregate(ty, origTy, field, index)) { if (isAggregate(ty) && !isLeafAggregate(ty, origTy, field, index)) {
if (auto packTy = dyn_cast<SILPackType>(ty)) { if (auto packTy = dyn_cast<SILPackType>(ty)) {
for (auto packIndex : indices(packTy->getElementTypes())) { for (auto packIndex : indices(packTy->getElementTypes())) {

View File

@@ -31,3 +31,9 @@ blackHole(G<Int, String>.self)
let g = G<Int, String, Float>() let g = G<Int, String, Float>()
blackHole(g.makeTuple1()) blackHole(g.makeTuple1())
blackHole(g.makeTuple2()) blackHole(g.makeTuple2())
struct VariadicOptionalTuple<each V> {
var v: (repeat (each V)?)
}
func useVOT(_: VariadicOptionalTuple<String>) {}