Skip to content

NSMutableData: Restore missing initialisers #1385

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

Merged
merged 1 commit into from
Jan 15, 2018

Conversation

spevans
Copy link
Contributor

@spevans spevans commented Dec 27, 2017

  • When aligning the init() methods with Darwin in PR NSData: Align methods with Darwin #1287,
    converting the NSData convenience methods to designated
    initialisers stopped them from being inherited by NSMutableData
    as it declared its own designed initialisers.

  • Add in all of the missing initialisers and add tests to ensure
    their presence is checked at compile time.

  • Fix init(data: Data) to use the correct length of the data
    argument when copying the bytes.

- When aligning the init() methods with Darwin in PR swiftlang#1287,
  converting the NSData `convenience` methods to designated
  initialisers stopped them from being inherited by NSMutableData
  as it declared its own designed initialisers.

- Add in all of the missing initialisers and add tests to ensure
  their presence is checked at compile time.

- Fix init(data: Data) to use the correct length of the data
  argument when copying the bytes.
@spevans
Copy link
Contributor Author

spevans commented Dec 27, 2017

@swift-ci please test

@parkera parkera requested a review from phausler January 2, 2018 18:56
Copy link
Contributor

@phausler phausler left a comment

Choose a reason for hiding this comment

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

The rest looks fine to me

@@ -206,7 +206,6 @@ class TestNSData: XCTestCase {
("test_dataHash", test_dataHash),
("test_genericBuffers", test_genericBuffers),
("test_writeFailure", test_writeFailure),
("testBasicConstruction", testBasicConstruction),
Copy link
Contributor

Choose a reason for hiding this comment

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

why was this test removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was a duplicate line, that test is called on line 198

Copy link
Contributor

Choose a reason for hiding this comment

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

ah ok, I see it past the code fold

@spevans
Copy link
Contributor Author

spevans commented Jan 15, 2018

@swift-ci please test and merge

@swift-ci swift-ci merged commit 414ebff into swiftlang:master Jan 15, 2018
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.

3 participants