1#unittest {
2	name: "Complex nested classes example.";
3	error: NONE;
4	result: 667;
5};
6
7class c1 {
8	public var p1;
9
10	class c2 {
11		public var p2;
12
13		class c3 {
14			public var p3;
15
16			class c4 {
17
18				class c5 {
19					public var p6;
20
21					// c5 init
22					func init() {
23						p6 = 667;
24					}
25				}
26
27				func p5() {
28					return c5();
29				}
30			}
31
32			// c3 init
33			func init() {
34				p3 = [c4, c4, c4, c4];
35			}
36		}
37
38		// c2 init
39		func init() {
40			p2 = c3();
41		}
42	}
43
44	// c1 init
45	func init() {
46		p1 = c2();
47	}
48}
49
50func main() {
51	return c1().p1.p2.p3[2]().p5().p6;
52}