1
0
forked from Mirror/wren
Files
wren/test/this/nested_closure.wren
Bob Nystrom da4cadf16b Unify body handling.
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.
2014-04-03 07:48:19 -07:00

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