Skip to content

Commit 1e27f26

Browse files
committed
[Sema] Always cache the unresolved chain base
Even when we’ve already visited the expression for constraint generation (signified by the presence of an UnresolvedMemberChainResultExpr) we should still cache the chain base.
1 parent c33ad11 commit 1e27f26

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/CSGen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3845,8 +3845,8 @@ namespace {
38453845
auto *parent = Parent.getAsExpr();
38463846
if (isMemberChainTail(expr, parent)) {
38473847
if (auto *UME = getUnresolvedMemberChainBase(expr)) {
3848+
CG.setUnresolvedChainBase(expr, UME);
38483849
if (!parent || !isa<UnresolvedMemberChainResultExpr>(parent)) {
3849-
CG.setUnresolvedChainBase(expr, UME);
38503850
auto &context = CG.getConstraintSystem().getASTContext();
38513851
expr = new (context) UnresolvedMemberChainResultExpr(expr);
38523852
}

0 commit comments

Comments
 (0)