mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 12:22:42 +00:00
22 lines
322 B
Lox
22 lines
322 B
Lox
class Base {
|
|
method() {
|
|
print "Base.method()";
|
|
}
|
|
}
|
|
|
|
class Derived < Base {
|
|
method() {
|
|
super.method();
|
|
}
|
|
}
|
|
|
|
class OtherBase {
|
|
method() {
|
|
print "OtherBase.method()";
|
|
}
|
|
}
|
|
|
|
var derived = Derived();
|
|
derived.method(); // expect: Base.method()
|
|
Base = OtherBase;
|
|
derived.method(); // expect: Base.method()
|