Feedback
Warn when a local variable hides a method or property
- 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
Identifiers are case-insensitive, so a local variable can silently hide a method or property of the enclosing class or module. For example, declaring Var fmt As String inside a method that belongs to a type with a Fmt() method means the name now resolves to the local; later code that calls Fmt(...) produces confusing errors that do not point at the shadowing declaration.
Requested: extend the existing "shadows" compiler warning, which today covers locals hiding variables, parameters, and member constants, to also warn when a local variable or parameter hides a method, property, or computed property of its enclosing class or module.