@@ -178,6 +178,8 @@ namespace {
178178 class TypeClassifierBase
179179 : public CanTypeVisitor<Impl, RetTy, AbstractionPattern, IsTypeExpansionSensitive_t>
180180 {
181+ using super =
182+ CanTypeVisitor<Impl, RetTy, AbstractionPattern, IsTypeExpansionSensitive_t>;
181183 Impl &asImpl () { return *static_cast <Impl*>(this ); }
182184 protected:
183185 TypeConverter &TC;
@@ -285,6 +287,15 @@ namespace {
285287 RecursiveProperties::forOpaque ());
286288 }
287289
290+ RetTy visit (CanType substType, AbstractionPattern origType,
291+ IsTypeExpansionSensitive_t isSensitive) {
292+ if (auto origEltType = origType.getVanishingTupleElementPatternType ()) {
293+ return visit (substType, *origEltType, isSensitive);
294+ }
295+
296+ return super::visit (substType, origType, isSensitive);
297+ }
298+
288299#define IMPL (TYPE, LOWERING ) \
289300 RetTy visit##TYPE##Type(Can##TYPE##Type type, AbstractionPattern orig, \
290301 IsTypeExpansionSensitive_t isSensitive) { \
@@ -2900,7 +2911,10 @@ TypeConverter::computeLoweredRValueType(TypeExpansionContext forExpansion,
29002911 LoweredRValueTypeVisitor (TypeConverter &TC,
29012912 TypeExpansionContext forExpansion,
29022913 AbstractionPattern origType)
2903- : TC(TC), forExpansion(forExpansion), origType(origType) {}
2914+ : TC(TC), forExpansion(forExpansion), origType(origType) {
2915+ if (auto origEltType = origType.getVanishingTupleElementPatternType ())
2916+ origType = *origEltType;
2917+ }
29042918
29052919 // AST function types are turned into SIL function types:
29062920 // - the type is uncurried as desired
0 commit comments