Skip to content

[4.1] [PrintAsObjC] More tweaks to +new unavailability #13433

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

  • Explanation: Another follow-up to Fix SR-6060: marking +new unavailable when -init is unavailable #12295. Downgrades +new unavailability to deprecation in pre-Swift-5 modes. This change isn't perfect because the diagnostic appears in clients rather than in the module that's being compiled as Swift 4 (instead of Swift 5). But it still means that someone who hasn't changed anything from a valid Swift 4.0 project will be able to compile without any changes, even if they were relying on being able to call +new when -init was unavailable for some reason.
  • Scope: Only affects classes that hide or don't inherit NSObject's init()
  • Issue: rdar://problem/35942058
  • Reviewed by: @DougGregor, @JaviSoto
  • Risk: Low. Only affects ObjC printing, not any run-time behavior.
  • Testing: Added compiler regression tests.

[PrintAsObjC] More tweaks to +new unavailability

rdar://problem/35942058
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple jrose-apple merged commit cf6dfe6 into swiftlang:swift-4.1-branch Dec 14, 2017
@jrose-apple jrose-apple deleted the 4.1-newer-and-improveder branch December 14, 2017 19:05
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