Skip to content

Commit b0869fa

Browse files
committed
Sema: Don't construct TupleType with InOutType inside
1 parent c7f35dc commit b0869fa

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7308,8 +7308,11 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
73087308
// would be handled by existental promotion in cases where it's allowed.
73097309
if (isTupleWithUnresolvedPackExpansion(origType1) ||
73107310
isTupleWithUnresolvedPackExpansion(origType2)) {
7311-
if (desugar1->is<TupleType>() != desugar2->is<TupleType>() &&
7312-
(!desugar1->isAny() && !desugar2->isAny())) {
7311+
if (isa<TupleType>(desugar1) != isa<TupleType>(desugar2) &&
7312+
!isa<InOutType>(desugar1) &&
7313+
!isa<InOutType>(desugar2) &&
7314+
!desugar1->isAny() &&
7315+
!desugar2->isAny()) {
73137316
return matchTypes(
73147317
desugar1->is<TupleType>() ? type1
73157318
: TupleType::get({type1}, getASTContext()),

0 commit comments

Comments
 (0)