Skip to content

[4.1] [PrintAsObjC] Reintroduce +new when reintroducing -init #13331

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

Conversation

jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Dec 7, 2017

  • Explanation: An unavailable -init makes +new unavailable, but reintroducing it in a subclass should reintroduce +new if the root class is NSObject (where +new is implemented).
  • Scope: Only affects classes that implement a non-overriding init() exposed to Objective-C
  • Issue: rdar://problem/35914080 rdar://problem/35941258
  • Reviewed by: @DougGregor, @JaviSoto
  • Risk: Low. Only affects ObjC printing, not any run-time behavior.
  • Testing: Added compiler regression tests.

…3320)

Follow-up to 49c65fa to account for subclasses. An unavailable
-init makes +new unavailable, but reintroducing it in a subclass
should reintroduce +new if the root class is NSObject (where +new is
implemented).

rdar://problem/35914080
(cherry picked from commit 2bc0106)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

Ewa, can you mark this as approved so it can be merged? (And then feel free to merge rather than wait for me to notice.)

@ematejska ematejska merged commit 54e3200 into swiftlang:swift-4.1-branch Dec 11, 2017
@jrose-apple jrose-apple deleted the 4.1-new-and-improved branch December 11, 2017 23:14
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