Debian Codegraph @

src/test/06-Errors/error-depend-class-extend.ck

raw
1 // test declaring/instantation classes with inheritance, involving
2 // a member variable, declared in the file below its access
3
4 class Bar
5 {
6 // this implicitly uses Bar.name...
7 // also would cause a infinite loop, but won't get that far
8 BarFactory.make();
9 // the var
10 "i am bar" => string name;
11 }
12
13 class BarChild extends Bar
14 {
15 "success" => name;
16 }
17
18 class BarFactory
19 {
20 fun static BarChild make()
21 {
22 return new BarChild;
23 }
24 }
25
26 // shouldn't quite get to here
27 BarFactory.make();