Skip to content

Commit 8c39afd

Browse files
committed
[BuilderTransform] Use correct locator for case subject expressions
Instead of `CTP_Initialization` transform should use `CTP_CaseStmt` to identify the root correctly.
1 parent 44e8004 commit 8c39afd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/BuilderTransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,7 @@ class BuilderClosureVisitor
733733
// If needed, generate constraints for everything in the case statement.
734734
if (cs) {
735735
auto locator = cs->getConstraintLocator(
736-
subjectExpr, LocatorPathElt::ContextualType(CTP_Initialization));
736+
subjectExpr, LocatorPathElt::ContextualType(CTP_CaseStmt));
737737
Type subjectType = cs->getType(subjectExpr);
738738

739739
if (cs->generateConstraints(caseStmt, dc, subjectType, locator)) {

0 commit comments

Comments
 (0)