Feedback
Custom exception constructors with enum parameters execute the wrong constructor
- Status
- Fixed
- Fixed in
- v26.11.4
- Area
- compiler ide
- Source discussion
- https://forum.objo.dev/d/1534-custom-exception
- Last updated
- 2026-11-16
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Constructing a custom exception with an enum parameter can skip its constructor and run the inherited Exception constructor instead. The exception's Message can then contain a number despite being declared as a String, causing string APIs such as MessageBox to fail. The constructor matching the declared enum parameter should run and preserve the intended error message.
Adding a dummy Boolean parameter changes the behaviour. The associated report also describes a VM crash when throwing that variant while debugging; investigate that failure alongside the constructor bug.