Skip to content

[NSMutableArray] replace objects in range docs/tests/impl #136

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

Conversation

cullenbmacdonald
Copy link
Contributor

I think I found a bug while writing these tests. Not sure what the process is for filing it, but I was getting a a complier error "Int does not conform to expected element type AnyObject" when doing NSMutableArray(array: [1, 2, 3]) which seems...wrong.

Tested on latests official xcode build from app store and it definitely works.

Will be happy to try and resolve that issue before this gets merged as the tests look a little verbose as a result of the bug.

@@ -1041,36 +1043,37 @@
EA66F65A1BF1976100136161 /* Tests */ = {
isa = PBXGroup;
children = (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

simply sorted the order here.

@parkera
Copy link
Contributor

parkera commented Dec 13, 2015

What you're seeing is the lack of implicit bridging from Int to NSNumber. AnyObject requires that the type is a class type. Int is not a class type unless it's bridged to an NSNumber.

Unfortunately this is expected behavior until we can get implicit bridging figured out when the ObjC runtime is not present.

@cullenbmacdonald
Copy link
Contributor Author

got it. that makes a lot of sense. Do I need to change anything about this pull then?

/// Replaces the objects in the receiving array specified by one given range with the objects in another array specified by another range.
/// - parameter range: The range of objects to be replaced in (or removed from) the receiving array.
/// - parameter otherArray: The array of objects from which to select replacements for the objects in `range`.
/// - parameter otherRnage: The range of objects be selected from `otherArray` as replacements for the objects in `range`.
Copy link
Contributor

Choose a reason for hiding this comment

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

typo here in otherRnage

@parkera
Copy link
Contributor

parkera commented Dec 13, 2015

Other than the typo, looks good to me.

@cullenbmacdonald
Copy link
Contributor Author

fixed

@joshuatbrown
Copy link
Contributor

@thii
Copy link
Contributor

thii commented Dec 16, 2015

From the Contribution Guidelines:

Before embarking on a large amount of work to implement missing functionality, please double-check with the community on the swift-corelibs-dev mailing list. Someone may already be working in this area, and we want to avoid duplication of work.

@cullenbmacdonald
Copy link
Contributor Author

My mistake. Dunno how I missed #125! ill be more careful next time

atrick pushed a commit to atrick/swift-corelibs-foundation that referenced this pull request Jan 12, 2021
[test] Update for TestLocation utf8/16 change
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
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.

5 participants