[CSSimplify] For function type binding for key path types, add flag

to allow it to go through resolveKeyPath in matchTypesBindTypeVar.
This commit is contained in:
Amritpan Kaur
2023-08-15 10:39:50 -07:00
parent b2f46ba26f
commit feb0f34993

View File

@@ -6827,8 +6827,9 @@ ConstraintSystem::matchTypes(Type type1, Type type2, ConstraintKind kind,
// unexpected state for key path diagnostics should we fail.
if (locator->isLastElement<LocatorPathElt::KeyPathType>() &&
type2->is<AnyFunctionType>())
return matchTypesBindTypeVar(typeVar1, type2, kind, flags, locator,
formUnsolvedResult);
return matchTypesBindTypeVar(typeVar1, type2, kind,
flags | TMF_BindingTypeVariable,
locator, formUnsolvedResult);
}
// Performance optimization: Propagate fully or partially resolved