Remove explicit ==, hashing definitions from RawRepresentable types #2134
+8
−140
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements @millenomi's review note in #2118 (comment).
Remove explicit definitions for == and
hash(into:)
from Foundation's enum-like RawRepresentable types. The stdlib provides identical definitions in conditional extensions of RawRepresentable.Note: This would be an ABI-breaking change in Darwin's Foundation overlays because it removes these symbols; but it seems a reasonable simplification for corelibs-foundation, where AFAIK we don't have to be compatible with Swift 5's ABI.
Note also that RawRepresentable's definitions are inlinable, while the original definitions weren't. The corresponding definitions on Darwin are already inlinable, so this is unlikely to cause new issues.