Skip to content

Commit 6e580be

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 (cherry picked from commit d48fea8)
1 parent 7f9c21a commit 6e580be

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
@@ -2756,8 +2756,8 @@ namespace {
27562756
auto locator = CS.getConstraintLocator(expr);
27572757
auto projectedTy = CS.createTypeVariable(locator,
27582758
TVO_CanBindToLValue);
2759-
CS.addKeyPathApplicationConstraint(expr->getKeyPath()->getType(),
2760-
expr->getBase()->getType(),
2759+
CS.addKeyPathApplicationConstraint(CS.getType(expr->getKeyPath()),
2760+
CS.getType(expr->getBase()),
27612761
projectedTy,
27622762
locator);
27632763
return projectedTy;

0 commit comments

Comments
 (0)