Files
wren/test/nonlocal/duplicate_nonlocal.wren
T
Bob Nystrom a8e2ba233c Add support for "nonlocal" (capitalized) names, and change how variable lookup works.
Inside a method, all local variable lookup stops at the method boundary. In other
words, methods, do not close over outer local variables.

If a name is not found inside a method and is lowercase, it's a method on this.
If it's capitalized, it's a global variable.
2015-01-13 21:36:42 -08:00

7 lines
82 B
Plaintext

class Foo {
bar {
var A = "value"
var A = "other" // expect error
}
}