Studio allows a normal method to be named Constructor, producing invalid source
- Status
- Fixed
- Fixed in
- v26.5.4
- Source discussion
- https://forum.objo.dev/d/40-more-questions/reply
- Last updated
- 2026-05-17
Public summary
The IDE's method editor currently allows a user to create a normal method and rename it to Constructor. This generates a method declaration equivalent to Sub Constructor(), but Constructor is an ObjoBasic keyword and cannot be used as a method identifier. The compiler then rejects the source.
Steps to reproduce:
- Create or open a class.
- Add a normal method.
- Rename the method to "Constructor".
- Try to compile/run.
Actual result:
The IDE accepts the name in the UI, but the generated source is invalid and compilation fails.
Expected result:
The IDE should prevent reserved keywords from being used as ordinary member names. For Constructor and Destructor, the IDE should direct the user to the dedicated "Add Constructor" / "Add Destructor" commands, or convert the member to the correct member kind.
Notes:
The engine supports real constructors using:
Constructor(...)
End Constructor