Skip to content

[Typechecker] Remove 'NSObject.hashValue' warning now that hashValue is no longer marked 'open' #29328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4674,9 +4674,6 @@ WARNING(non_exhaustive_switch_unknown_only,none,
"switch covers known cases, but %0 may have additional unknown values"
"%select{|, possibly added in future versions}1", (Type, bool))

WARNING(override_nsobject_hashvalue_warning,none,
"override of 'NSObject.hashValue' is deprecated; "
"did you mean to override 'NSObject.hash'?", ())
ERROR(override_nsobject_hashvalue_error,none,
"'NSObject.hashValue' is not overridable; "
"did you mean to override 'NSObject.hash'?", ())
Expand Down
10 changes: 0 additions & 10 deletions lib/Sema/TypeCheckDeclOverride.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,16 +1754,6 @@ static bool checkSingleOverride(ValueDecl *override, ValueDecl *base) {
diagnoseOverrideForAvailability(override, base);
}

// Overrides of NSObject.hashValue are deprecated; one should override
// NSObject.hash instead.
// FIXME: Remove this when NSObject.hashValue becomes non-open in
// swift-corelibs-foundation.
if (isNSObjectHashValue(base) &&
base->hasOpenAccess(override->getDeclContext())) {
override->diagnose(diag::override_nsobject_hashvalue_warning)
.fixItReplace(SourceRange(override->getNameLoc()), "hash");
}

/// Check attributes associated with the base; some may need to merged with
/// or checked against attributes in the overriding declaration.
AttributeOverrideChecker attrChecker(base, override);
Expand Down