Skip to content

Commit 6b70f4a

Browse files
committed
[NFC] Remove synthesis of @lvalue in typing judgement
Only two more of these exist 1) CSGen's formation of @lvalue -> inout conversion constraints 2) WritableKeyPath's checking rules Both can be eliminated but will require more refactoring.
1 parent 38abc74 commit 6b70f4a

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
@@ -2299,11 +2299,13 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
22992299

23002300
if (concrete && kind >= ConstraintKind::OperatorArgumentConversion) {
23012301
// If the RHS is an inout type, the LHS must be an @lvalue type.
2302-
if (auto *iot = type2->getAs<InOutType>()) {
2303-
return matchTypes(type1, LValueType::get(iot->getObjectType()),
2304-
kind, subflags,
2305-
locator.withPathElement(
2306-
ConstraintLocator::LValueConversion));
2302+
if (auto *lvt = type1->getAs<LValueType>()) {
2303+
if (auto *iot = type2->getAs<InOutType>()) {
2304+
return matchTypes(lvt->getObjectType(), iot->getObjectType(),
2305+
kind, subflags,
2306+
locator.withPathElement(
2307+
ConstraintLocator::LValueConversion));
2308+
}
23072309
}
23082310
}
23092311

0 commit comments

Comments
 (0)