Skip to content

Commit 451074a

Browse files
authored
[Typechecker] Remove 'NSObject.hashValue' warning now that it is an error (and because 'hashValue' is longer 'open') (#29328)
1 parent 82a4e4f commit 451074a

File tree

2 files changed

+0
-13
lines changed

2 files changed

+0
-13
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4730,9 +4730,6 @@ WARNING(non_exhaustive_switch_unknown_only,none,
47304730
"switch covers known cases, but %0 may have additional unknown values"
47314731
"%select{|, possibly added in future versions}1", (Type, bool))
47324732

4733-
WARNING(override_nsobject_hashvalue_warning,none,
4734-
"override of 'NSObject.hashValue' is deprecated; "
4735-
"did you mean to override 'NSObject.hash'?", ())
47364733
ERROR(override_nsobject_hashvalue_error,none,
47374734
"'NSObject.hashValue' is not overridable; "
47384735
"did you mean to override 'NSObject.hash'?", ())

lib/Sema/TypeCheckDeclOverride.cpp

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1859,16 +1859,6 @@ static bool checkSingleOverride(ValueDecl *override, ValueDecl *base) {
18591859
diagnoseOverrideForAvailability(override, base);
18601860
}
18611861

1862-
// Overrides of NSObject.hashValue are deprecated; one should override
1863-
// NSObject.hash instead.
1864-
// FIXME: Remove this when NSObject.hashValue becomes non-open in
1865-
// swift-corelibs-foundation.
1866-
if (isNSObjectHashValue(base) &&
1867-
base->hasOpenAccess(override->getDeclContext())) {
1868-
override->diagnose(diag::override_nsobject_hashvalue_warning)
1869-
.fixItReplace(SourceRange(override->getNameLoc()), "hash");
1870-
}
1871-
18721862
/// Check attributes associated with the base; some may need to merged with
18731863
/// or checked against attributes in the overriding declaration.
18741864
AttributeOverrideChecker attrChecker(base, override);

0 commit comments

Comments
 (0)