Skip to content

Commit f43aad2

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 a4fbb3e commit f43aad2

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
@@ -758,7 +758,7 @@ class BuilderClosureVisitor
758758
// If needed, generate constraints for everything in the case statement.
759759
if (cs) {
760760
auto locator = cs->getConstraintLocator(
761-
subjectExpr, LocatorPathElt::ContextualType(CTP_Initialization));
761+
subjectExpr, LocatorPathElt::ContextualType(CTP_CaseStmt));
762762
Type subjectType = cs->getType(subjectExpr);
763763

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

0 commit comments

Comments
 (0)