Files
wren/test/language/variable/local_outside_method.wren
Bob Nystrom 24cbb7f399 Fix closures in methods.
A local name inside a method should always resolve to a self send even
if there is a local variable with that name outside of the method.
2015-10-05 07:44:51 -07:00

23 lines
307 B
Plaintext

{
var foo = "variable"
class Foo {
construct new() {}
foo { "method" }
method {
System.print(foo)
}
static foo { "class method" }
static classMethod {
System.print(foo)
}
}
Foo.new().method // expect: method
Foo.classMethod // expect: class method
}