Skip to content

Commit 7453d53

Browse files
committed
[TypeChecker/BuilderTransform] Switch to use hasLValueType instead of is<LValueType> to cover all cases where load is expected
1 parent 6d67102 commit 7453d53

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ class BuilderClosureRewriter
693693
declRef->setType(LValueType::get(temporaryVar->getType()));
694694

695695
// Load the right-hand side if needed.
696-
if (finalCapturedExpr->getType()->is<LValueType>()) {
696+
if (finalCapturedExpr->getType()->hasLValueType()) {
697697
finalCapturedExpr =
698698
TypeChecker::addImplicitLoadExpr(ctx, finalCapturedExpr);
699699
}
@@ -839,7 +839,7 @@ class BuilderClosureRewriter
839839
auto finalCondExpr = rewriteExpr(condExpr);
840840

841841
// Load the condition if needed.
842-
if (finalCondExpr->getType()->is<LValueType>()) {
842+
if (finalCondExpr->getType()->hasLValueType()) {
843843
finalCondExpr = TypeChecker::addImplicitLoadExpr(ctx, finalCondExpr);
844844
}
845845

0 commit comments

Comments
 (0)