Skip to content
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

[SR-5018] Mark +new as SWIFT_UNAVAILABLE when -init is SWIFT_UNAVAILABLE. #47595

Closed
belkadan opened this issue May 25, 2017 · 2 comments
Closed
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers PrintAsClang Area → compiler: The PrintAsClang library

Comments

@belkadan
Copy link
Contributor

Previous ID SR-5018
Radar rdar://problem/32405588
Original Reporter @belkadan
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, PrintAsObjC, StarterBug
Assignee @JaviSoto
Priority Medium

md5: 1bd3c0ab436a3a00f70df1435d7ca4d0

is duplicated by:

  • SR-6060 +new not marked SWIFT_UNAVAILABLE when -init is unavailable when using required

Issue Description:

In Objective-C, [SomeClass new] is shorthand for [[SomeClass alloc] init] when SomeClass is an NSObject subclass. As such, if we're marking the no-argument initializer unavailable in Objective-C, we should do the same for +new. (The place we detect this is printAbstractFunctionAsMethod in PrintAsObjC.cpp, but that may not be the best place to print another declaration.)

@JaviSoto
Copy link
Contributor

JaviSoto commented Oct 5, 2017

lembacon (JIRA User) unaware that there was already an in-progress ticket for this I had started working on it. Are you still working on this?

@JaviSoto
Copy link
Contributor

JaviSoto commented Oct 5, 2017

The tests are passing on my patch, so I decided to create a PR for it: #12295 but feel free to close it in favor of yours if you already had something in the works!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself good first issue Good for newcomers PrintAsClang Area → compiler: The PrintAsClang library
Projects
None yet
Development

No branches or pull requests

2 participants