Skip to content

NSCopying for NSDictionary #68

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

Closed
wants to merge 3 commits into from

Conversation

MaddTheSane
Copy link
Contributor

This patch implements NSCopying and NSMutableCopying protocols in NSDictionary, as well as creating a couple of test methods for verifying the behavior of the copy methods.

} else if self.dynamicType === NSMutableDictionary.self {
// Otherwise, create a new NSDictionary object

// TODO: speed up?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

technically you could create a NSDictionary by returning one created via the storage directly.

// Otherwise, create a new NSDictionary object

let newDict = NSDictionary()
newDict._storage = _storage
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally I would prefer a better isolation of control however the compiler has some issues with NSDictionary.init(dictionary: [NSObject, AnyObject])

@phausler
Copy link
Contributor

phausler commented Dec 8, 2015

the change looks good however this is causing a crash in the compiler for me

1.  While emitting SIL for 'copyWithZone' at Foundation/NSDictionary.swift:150:12
Segmentation fault (core dumped)

@phausler
Copy link
Contributor

This functionality has been merged in already that did not have the compiler crashes.

@phausler phausler closed this Jan 22, 2016
atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
Completion item returns type name in details
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Apr 29, 2021
[XFail] Test LLDBB with SwiftPM (56054057)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants