Skip to content

Commit 80919e9

Browse files
committed
Sema: Don't clone TypeReprs in ConstraintSystem::shrink()
1 parent 4eb5689 commit 80919e9

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/Sema/CSSolver.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -991,13 +991,8 @@ void ConstraintSystem::shrink(Expr *expr) {
991991
auto typeRepr = castTypeLoc.getTypeRepr();
992992

993993
if (typeRepr && isSuitableCollection(typeRepr)) {
994-
// Clone representative to avoid modifying in-place,
995-
// FIXME: We should try and silently resolve the type here,
996-
// instead of cloning representative.
997-
auto coercionRepr = typeRepr->clone(CS.getASTContext());
998-
// Let's try to resolve coercion type from cloned representative.
999994
auto resolution = TypeResolution::forContextual(CS.DC, None);
1000-
auto coercionType = resolution.resolveType(coercionRepr);
995+
auto coercionType = resolution.resolveType(typeRepr);
1001996

1002997
// Looks like coercion type is invalid, let's skip this sub-tree.
1003998
if (coercionType->hasError())

0 commit comments

Comments
 (0)