Add specific warning for overriden NSObject.hash(into:)

This commit is contained in:
Minhyuk Kim
2021-01-17 23:45:02 +09:00
parent a6b85522f5
commit f138ce0b19
4 changed files with 30 additions and 7 deletions

View File

@@ -12,7 +12,6 @@ class Foo: NSObject {
}
override func hash(into hasher: inout Hasher) {
// expected-error@-1 {{overriding non-open instance method outside of its defining module}}
// expected-error@-2 {{overriding declarations in extensions is not supported}}
// expected-error@-1 {{`NSObject.hash(into:)` is not overridable; subclasses can customize hashing by overriding the `hash` property}}
}
}