lox/tests/class_tests.lox
Adnan Ioricce 77c0845f61 [Chapter13&Inheritance] - Adding tests;Bugs found
- Refactors will be necessary, the interpreter is not working as expected
- Try to execute the tests to check the errors
- It seems some funcionality with the scanner or resolver is not working
- Debugging is necessary.
2024-10-06 13:13:50 +00:00

36 lines
394 B
Plaintext

class A {
method() {
print "A method";
}
}
class B < A {
method() {
print "B method";
}
test() {
super.method();
}
}
class C < B {}
C().test();
class Doughnut {
cook() {
print "Fry until golden brown.";
}
}
class BostonCream < Doughnut {
cook() {
super.cook();
print "Pipe full of custard and coat with chocolate.";
}
}
BostonCream().cook();