Skip to content

Commit d48fea8

Browse files
committed
[ConstraintSystem] Use the type cache to read types in constraint generation.
We should pretty much always be reading expression types out of the type cache in the constraint system. We only see key path applications here on the path where we are diagnosing a failure. I haven't yet managed to come up with a test case that reproduces a crash here. Fixes: rdar://problem/41306933
1 parent 33d1fc9 commit d48fea8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/Sema/CSGen.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,8 +2799,8 @@ namespace {
27992799
auto locator = CS.getConstraintLocator(expr);
28002800
auto projectedTy = CS.createTypeVariable(locator,
28012801
TVO_CanBindToLValue);
2802-
CS.addKeyPathApplicationConstraint(expr->getKeyPath()->getType(),
2803-
expr->getBase()->getType(),
2802+
CS.addKeyPathApplicationConstraint(CS.getType(expr->getKeyPath()),
2803+
CS.getType(expr->getBase()),
28042804
projectedTy,
28052805
locator);
28062806
return projectedTy;

0 commit comments

Comments
 (0)