File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -2758,16 +2758,15 @@ bool TypeConverter::visitAggregateLeaves(
2758
2758
packIndex);
2759
2759
}
2760
2760
} else if (auto tupleTy = ty->getAs <TupleType>()) {
2761
- for (unsigned tupleIndex = 0 , num = tupleTy->getNumElements ();
2762
- tupleIndex < num; ++tupleIndex) {
2763
- auto origElementTy = origTy.getTupleElementType (tupleIndex);
2764
- auto substElementTy =
2765
- tupleTy->getElementType (tupleIndex)->getCanonicalType ();
2766
- substElementTy =
2767
- computeLoweredRValueType (context, origElementTy, substElementTy);
2768
- insertIntoWorklist (substElementTy, origElementTy, nullptr ,
2769
- tupleIndex);
2770
- }
2761
+ unsigned tupleIndex = 0 ;
2762
+ origTy.forEachExpandedTupleElement (
2763
+ CanTupleType (tupleTy),
2764
+ [&](auto origElementTy, auto substElementTy, auto element) {
2765
+ substElementTy = substOpaqueTypesWithUnderlyingTypes (substElementTy, context);
2766
+ insertIntoWorklist (substElementTy, origElementTy, nullptr ,
2767
+ tupleIndex);
2768
+ ++tupleIndex;
2769
+ });
2771
2770
} else if (auto *decl = ty->getStructOrBoundGenericStruct ()) {
2772
2771
for (auto *structField : decl->getStoredProperties ()) {
2773
2772
auto subMap = ty->getContextSubstitutionMap (&M, decl);
You can’t perform that action at this time.
0 commit comments