gcc/testsuite/gdc.test/fail_compilation/fail276.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail276.d(19): Error: `this` has no effect |
| 5 | fail_compilation/fail276.d(15): Error: cannot construct anonymous nested class because no implicit `this` reference to outer class is available |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | class C |
| 10 | { |
| 11 | this() |
| 12 | { |
| 13 | auto i = new class() |
| 14 | { |
| 15 | auto k = new class() |
| 16 | { |
| 17 | void func() |
| 18 | { |
| 19 | this.outer.outer; |
| 20 | } |
| 21 | }; |
| 22 | }; |
| 23 | } |
| 24 | int i; |
| 25 | } |
| 26 | void main() {} |