Skip to content

Commit 8d3913d

Browse files
committed
[CS] Decline to handle InlineArray in shrink
Previously we would try the contextual type `(<int>, <element>)`, which is wrong. Given we want to eliminate shrink, let's just bail.
1 parent deb1d96 commit 8d3913d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,11 @@ void ConstraintSystem::shrink(Expr *expr) {
11811181
if (boundGeneric->hasUnresolvedType())
11821182
return boundGeneric;
11831183

1184+
// Avoid handling InlineArray, building a tuple would be wrong, and
1185+
// we want to eliminate shrink.
1186+
if (boundGeneric->getDecl() == ctx.getInlineArrayDecl())
1187+
return Type();
1188+
11841189
llvm::SmallVector<TupleTypeElt, 2> params;
11851190
for (auto &type : boundGeneric->getGenericArgs()) {
11861191
// One of the generic arguments in invalid or unresolved.

0 commit comments

Comments
 (0)