Subclass compiles without initializing properties #69965
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
Description
When subclassing an
open
class from another module, Swift is not warning me if I have neglect to initialize all properties in my subclass. It unexpectedly builds fine but crashes at runtime.Steps to reproduce
ModuleA:
ModuleB:
hi
is never initialized, but this builds.Expected behavior
I expect an error like:
Class 'MySubclass' has no initializers: Stored property 'hi' without initial value prevents synthesized initializers
. If I remove the inheritance clause fromMySubclass
I do get this error.Environment
Target: arm64-apple-macosx14.0
The text was updated successfully, but these errors were encountered: