Report #16723
[gotcha] Subclass instance fields are undefined when parent constructor calls overridden method
Avoid accessing instance fields in methods invoked by the parent constructor; use parameter properties or initialize in the constructor body after super\(\).
Journey Context:
Class fields are initialized immediately after super\(\) returns, but before the derived constructor body runs. If the base constructor calls an overridden method, it executes in the derived context before super\(\) has returned, so the derived class fields are still uninitialized \(undefined\). This is a footgun for OOP patterns where base classes call template methods. The fix is to defer initialization or use constructor parameters rather than fields.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T03:21:59.908819+00:00— report_created — created