1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/fail59.d(50): Error: outer class C1 'this' needed to 'new' nested class C2
5 ---
6 */
7 
8 class C1
9 {
10     int c1;
11 
this()12     this()
13     {
14         c1 = 2;
15     }
16 
17     class C2
18     {
19         class C3
20         {
21             int c3;
22 
this(int n)23             this(int n)
24             {
25                 c3 = n + c1 + c2;
26             }
27         }
28 
29         int c2;
30 
foo()31         C3 foo()
32         {
33             return new C3(8);
34         }
35 
this(int k)36         this(int k)
37         {
38             c2 = k + 7;
39         }
40     }
41 
bar()42     C2 bar()
43     {
44         return new C2(17);
45     }
46 }
47 
main()48 void main()
49 {
50     C1.C2 q = new C1.C2(3);
51 }
52