[CSBindings] Key path cannot be bound to typ erased type even if its existential

Extend existing check to handle type erased versions when they
are wrapped in an existential.
This commit is contained in:
Pavel Yaskevich
2023-12-18 11:09:26 -08:00
parent fe2f1cab52
commit a288b1eb76
3 changed files with 19 additions and 1 deletions

View File

@@ -6389,6 +6389,11 @@ public:
/// for a key path `{Any, Partial, Writable, ReferenceWritable}KeyPath`.
bool isKnownKeyPathType(Type type);
/// Determine whether the given type is a PartialKeyPath and
/// AnyKeyPath or existential type thererof, for example,
/// `PartialKeyPath<...> & Sendable`.
bool isTypeErasedKeyPathType(Type type);
/// Determine whether given declaration is one for a key path
/// `{Writable, ReferenceWritable}KeyPath`.
bool isKnownKeyPathDecl(ASTContext &ctx, ValueDecl *decl);