[Sema] Diagnose method arg captures that are not Hashable/Equatable.

This commit is contained in:
Amritpan Kaur
2025-01-16 19:07:00 -08:00
parent 970159c09d
commit a96b780a28
6 changed files with 36 additions and 8 deletions

View File

@@ -9073,8 +9073,9 @@ ConstraintSystem::SolutionKind ConstraintSystem::simplifyConformsToConstraint(
// If this is an implicit Hashable conformance check generated for each
// index argument of the keypath subscript component, we could just treat
// it as though it conforms.
if (loc->isResultOfKeyPathDynamicMemberLookup() ||
loc->isKeyPathSubscriptComponent()) {
if ((loc->isResultOfKeyPathDynamicMemberLookup() ||
loc->isKeyPathSubscriptComponent()) ||
loc->isKeyPathMemberComponent()) {
if (protocol ==
getASTContext().getProtocol(KnownProtocolKind::Hashable)) {
auto *fix =