forked from Mirror/wren
Blocks, functions, and methods now have the same code for handling their bodies. This means that single-line methods work like single-line functions: they return the result of their expression.
8 lines
178 B
Plaintext
8 lines
178 B
Plaintext
class Foo {
|
|
getClosure { new Fn { new Fn { new Fn { toString } } } }
|
|
toString { "Foo" }
|
|
}
|
|
|
|
var closure = (new Foo).getClosure
|
|
IO.print(closure.call.call.call) // expect: Foo
|