Files
wren/test/language/module_variable/outside_method.wren
Bob Nystrom 9df6aa2f8a Remove support for implicit self sends and convert everything to '@'.
This fixes the nasty case where "foo(bar)" is context-sensitive, and
generally simplifies the compiler a lot since there is a clear
distinction between lexical and dynamic scope.

Also:

- Remove the special handling of capitalized names since all names are
  lexical now.
- Allow methods to close over local variables in enclosing functions.
- Allow implicit definition of all lexical names.
2015-11-30 22:46:11 -08:00

21 lines
268 B
Plaintext

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