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