Feedback
Allow Private and Public visibility on module variables
- Status
- Fixed
- Fixed in
- v26.10.4
- Area
- compiler
- Source discussion
- https://forum.objo.dev/d/1354-some-feedback-from-building-chartview-web-support-and-a-few-language-notes
- Last updated
- 2026-10-30
Upvotes
0 upvotes
Uses your Objo forum account.
Public summary
Private Var x As Integer inside a Module is rejected with the compile error "Expected declaration after modifier." Module-level variables currently have no visibility modifiers at all, so module state is always public and cannot be encapsulated behind the module's methods.
Requested: allow Private (and explicit Public) on module-level Var declarations, so a module can keep internal state internal. Xojo allows visibility on module properties, and Objo modules already accept visibility modifiers on Sub, Function, Const, and Class members, so Var is the odd one out.