Retoor software development Projects Research SearchXNG
Register Sign In

7 lines
82 B
Plaintext
Raw Normal View History

feat: stop closure upvalue search at method boundaries and treat capitalized names as globals Modify `findUpvalue` in the compiler to return -1 when the enclosing function is a method, preventing closures from capturing outer local variables. Add a new `nonlocal` variable resolution path that treats capitalized identifiers as global variables rather than method receivers. Update existing test files to use capitalized global names and add new test cases for nonlocal assignment, duplicate nonlocal declarations, block scoping, and method-local variable shadowing.
2015-01-14 06:36:42 +01:00
class Foo {
bar {
var A = "value"
var A = "other" // expect error
}
}
Reference in New Issue Copy Permalink
2bcb3edbc7
wren/test/language/nonlocal/duplicate_nonlocal.wren
Response time: 199ms
Mail Licenses API