Skip to content

Commit 9f0c778

Browse files
committed
Sema: Don't construct TupleType with InOutType inside
1 parent 7949162 commit 9f0c778

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
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()),

validation-test/compiler_crashers_2/1470917329979c9a.swift renamed to validation-test/compiler_crashers_2_fixed/1470917329979c9a.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// {"signature":"swift::PackExpansionType::PackExpansionType(swift::Type, swift::Type, swift::RecursiveTypeProperties, swift::ASTContext const*)"}
2-
// RUN: not --crash %target-swift-frontend -typecheck %s
2+
// RUN: not %target-swift-frontend -typecheck %s
33
struct a < each b {
44
struct c {
55
d : (repeat(each b

0 commit comments

Comments
 (0)