mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[CS] Use apply component locator for verifyThatArgumentIsHashable
For a method key path use the locator for the apply itself rather than the member, ensuring we handle invalid cases where the apply is the first component, and providing more accurate location info.
This commit is contained in:
@@ -9221,9 +9221,10 @@ 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()) ||
|
||||
loc->isKeyPathMemberComponent()) {
|
||||
if (loc->isResultOfKeyPathDynamicMemberLookup() ||
|
||||
loc->isKeyPathSubscriptComponent() ||
|
||||
loc->isKeyPathMemberComponent() ||
|
||||
loc->isKeyPathApplyComponent()) {
|
||||
if (protocol ==
|
||||
getASTContext().getProtocol(KnownProtocolKind::Hashable)) {
|
||||
auto *fix =
|
||||
|
||||
Reference in New Issue
Block a user