zlox/samples/ch28_optimized_invocation.lox

18 lines
286 B
Plaintext
Raw Normal View History

2024-09-01 11:11:29 +02:00
class Oops {
init() {
fun f() {
print "not a method";
return "returned value from f";
}
this.field = f;
}
blah() {
return "returned value from blah";
}
}
var oops = Oops();
print oops.field();
print oops.blah();