File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -11550,14 +11550,17 @@ bool ConstraintSystem::resolveClosure(TypeVariableType *typeVar,
11550
11550
bool ConstraintSystem::resolveKeyPath(TypeVariableType *typeVar,
11551
11551
Type contextualType,
11552
11552
ConstraintLocatorBuilder locator) {
11553
-
11553
+ auto *keyPathLocator = typeVar->getImpl().getLocator();
11554
+ auto *keyPath = castToExpr<KeyPathExpr>(keyPathLocator->getAnchor());
11555
+ if (keyPath->hasSingleInvalidComponent()) {
11556
+ assignFixedType(typeVar, contextualType);
11557
+ return true;
11558
+ }
11554
11559
if (auto *BGT = contextualType->getAs<BoundGenericType>()) {
11555
11560
auto args = BGT->getGenericArgs();
11556
11561
if (isKnownKeyPathType(contextualType) && args.size() >= 1) {
11557
11562
auto root = BGT->getGenericArgs()[0];
11558
11563
11559
- auto *keyPathLocator = typeVar->getImpl().getLocator();
11560
- auto *keyPath = castToExpr<KeyPathExpr>(keyPathLocator->getAnchor());
11561
11564
auto *keyPathValueTV = getKeyPathValueType(keyPath);
11562
11565
contextualType = BoundGenericType::get(
11563
11566
args.size() == 1 ? getASTContext().getKeyPathDecl() : BGT->getDecl(),
You can’t perform that action at this time.
0 commit comments