mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 12:22:42 +00:00
13 lines
210 B
Lox
13 lines
210 B
Lox
class Foo {
|
|
getClosure() {
|
|
fun closure() {
|
|
return this.toString();
|
|
}
|
|
return closure;
|
|
}
|
|
|
|
toString() { return "Foo"; }
|
|
}
|
|
|
|
var closure = Foo().getClosure();
|
|
print closure(); // expect: Foo
|