Skip to content

Commit c49390f

Browse files
committed
[CSSimplify] Allow l-value object simplication if l-value type is a placeholder
Placeholders propagate but we still can allow contextual inference, to facilitate that the solver should consider `l-value object` constraint to be solved and allow placeholders on "object" type.
1 parent 0a4ff7d commit c49390f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14178,6 +14178,14 @@ ConstraintSystem::simplifyLValueObjectConstraint(
1417814178
return type->is<LValueType>();
1417914179
};
1418014180

14181+
if (lvalueTy->isPlaceholder()) {
14182+
if (!shouldAttemptFixes())
14183+
return SolutionKind::Error;
14184+
14185+
recordAnyTypeVarAsPotentialHole(type2);
14186+
return SolutionKind::Solved;
14187+
}
14188+
1418114189
if (!isOrCanBeLValueType(lvalueTy)) {
1418214190
if (!shouldAttemptFixes())
1418314191
return SolutionKind::Error;

0 commit comments

Comments
 (0)