Skip to content

Commit 96c8f9b

Browse files
authored
Merge pull request #16856 from CodaFi/formica
[NFC] Never synthesize @lvalue in typing judgements
2 parents 8151350 + 6b70f4a commit 96c8f9b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/Sema/CSSimplify.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2309,11 +2309,13 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
23092309

23102310
if (concrete && kind >= ConstraintKind::OperatorArgumentConversion) {
23112311
// If the RHS is an inout type, the LHS must be an @lvalue type.
2312-
if (auto *iot = type2->getAs<InOutType>()) {
2313-
return matchTypes(type1, LValueType::get(iot->getObjectType()),
2314-
kind, subflags,
2315-
locator.withPathElement(
2316-
ConstraintLocator::LValueConversion));
2312+
if (auto *lvt = type1->getAs<LValueType>()) {
2313+
if (auto *iot = type2->getAs<InOutType>()) {
2314+
return matchTypes(lvt->getObjectType(), iot->getObjectType(),
2315+
kind, subflags,
2316+
locator.withPathElement(
2317+
ConstraintLocator::LValueConversion));
2318+
}
23172319
}
23182320
}
23192321

0 commit comments

Comments
 (0)