[SR-10102] Objective-C stub method not created for non-override of designated initializer #52504
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
run-time crash
Bug → crash: Swift code crashed during execution
Additional Detail from JIRA
md5: f91d810d092893ba098c73f8965b0053
Issue Description:
In this contrived example using an underscored attribute, I can get into trouble with properties left uninitialized:
If Sub declared a designated initializer with a different name from
init(designated:)
, this would produce an error at run time saying that Sub did not implementinit(designated:)
. However, the non-overriding non-ObjC declaration shadows that potential stub and keeps it from getting generated, which leads to memory unsafety.We should fix this before productizing
@_nonoverriding
, or we should forbid@_nonoverriding
on designated initializers (possibly just in@objc
hierarchies).The text was updated successfully, but these errors were encountered: