Debian Codegraph @

src/test/06-Errors/error-super-no-func.ck

raw
1 class Parent
2 {
3 fun Parent()
4 {
5 <<< "Parent ctor" >>>;
6 }
7 }
8
9 class Child extends Parent
10 {
11 fun Child()
12 {
13 <<< "Child ctor" >>>;
14 }
15
16 fun void test()
17 {
18 <<< "Test start" >>>;
19
20 // should throw compile error since parent doesn't have this function
21 super.not_override();
22
23 <<< "Test complete" >>>;
24 }
25
26 fun void not_override()
27 {
28 <<< "Child not_override" >>>;
29 }
30 }
31
32 Child child;
33 child.test();