Suggest Super.Constructor(...) for mistaken superclass constructor calls
- Status
- Fixed
- Fixed in
- v26.11.1
- Area
- compiler
- Source discussion
- https://forum.objo.dev/d/1460-constructor-can-not-call-the-constructor-of-the-class-it-inherits-from
- Last updated
- 2026-11-04
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
When a developer writes an incorrect superclass constructor call, the compiler should suggest the correct syntax, Super.Constructor(...).
For example, a constructor in StringMemoryTableColumn Inherits MemoryTableColumn might contain:
Super.MemoryTableColumn(parentCollection)
The current diagnostic, Type 'MemoryTableColumn' has no member 'MemoryTableColumn'., does not explain how to call the parent constructor. Add a helpful suggestion such as: To call the superclass constructor, use Super.Constructor(parentCollection).
This would make constructor chaining easier to discover and avoid the mistaken workaround of removing Super., which turns this one-argument expression into a cast rather than initialising the current instance.