Fix requirements on values in NSSet and keys in NSDictionary#505
Merged
Fix requirements on values in NSSet and keys in NSDictionary#505
NSSet and keys in NSDictionary#505Conversation
c518730 to
7508af1
Compare
7508af1 to
60963e3
Compare
ee9d9f5 to
cfb2b9d
Compare
Add CounterpartOrSelf instead of CopyHelper, which lives in objc2 and is much nicer to use. This also allows us to move NSCopying and NSMutableCopying back to reside in Foundation (note: We might have to at some point implement a small hack for these traits acting as if they contain the `copy` method, while it's actually `NSObject` that does).
Almost at least, some generic types like `NSArray<NSView>` is still incorrectly allowed as a key
cfb2b9d to
7c9ff46
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Introduce
HasStableHashand use that to restrict the keys inNSSetandNSMutableDictionary, such that you cannot use e.g.NSViewas a key (since thehashandisEqual:implementations of that may change if the view changes).Addtionally, refactor and clean up the
NSCopying/NSMutableCopyingtrait definitions.Fixes #306 and fixes #337 - the remaining parts are moved to #507.