mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 14:18:42 +01:00
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.
23 lines
307 B
Plaintext
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
|
|
}
|