feat: add clearer error message for forward-referenced lowercase module variables
Add a new error code (-3) from wrenDefineVariable to detect when a lowercase (local-style) module variable is referenced before its definition. The compiler now reports the line of the first use, improving diagnostics for forward-declared top-level variables.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
if (false) {
|
||||
System.print(a)
|
||||
}
|
||||
|
||||
var a = 123 // expect error: Error at '123': Variable 'a' referenced before this definition (first use at line 2).
|
||||
Reference in New Issue
Block a user