You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A "non-convenience factory initializer" is a factory initializer that can't be inherited. You can't define these in Swift, but you can in Objective-C (by specifying an explicit return type instead of using instancetype). Swift's convenience initializers are inherited (as are Objective-C's), and so they shouldn't be allowed to delegate to non-convenience factory initializers (unless the class is final).
However…fixing this would be a source-breaking change, and we don't currently have a way to define what people want in Swift (a non-inherited factory initializer). Meanwhile, everything works fine if they only use the convenience initializer on the original class.
If we don't think we're going to get factory initializers in Swift soon, we should consider adding a run-time check that the Self type matches the type the factory initializer is going to create.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: b52c428950ae7b584dcb51a368f527bc
relates to:
Issue Description:
A "non-convenience factory initializer" is a factory initializer that can't be inherited. You can't define these in Swift, but you can in Objective-C (by specifying an explicit return type instead of using
instancetype
). Swift's convenience initializers are inherited (as are Objective-C's), and so they shouldn't be allowed to delegate to non-convenience factory initializers (unless the class is final).However…fixing this would be a source-breaking change, and we don't currently have a way to define what people want in Swift (a non-inherited factory initializer). Meanwhile, everything works fine if they only use the convenience initializer on the original class.
If we don't think we're going to get factory initializers in Swift soon, we should consider adding a run-time check that the Self type matches the type the factory initializer is going to create.
The text was updated successfully, but these errors were encountered: