[SR-5018] Mark +new as SWIFT_UNAVAILABLE when -init is SWIFT_UNAVAILABLE. #47595
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
PrintAsObjC
Additional Detail from JIRA
md5: 1bd3c0ab436a3a00f70df1435d7ca4d0
is duplicated by:
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 isprintAbstractFunctionAsMethod
in PrintAsObjC.cpp, but that may not be the best place to print another declaration.)The text was updated successfully, but these errors were encountered: