gcc/testsuite/gdc.test/fail_compilation/fail150.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail150.d(22): Error: `.new` is only for allocating nested classes |
| 5 | --- |
| 6 | */ |
| 7 | |
| 8 | //import std.stdio; |
| 9 | |
| 10 | class Class1 |
| 11 | { |
| 12 | } |
| 13 | |
| 14 | class Foo |
| 15 | { |
| 16 | } |
| 17 | |
| 18 | int main(char[][] argv) |
| 19 | { |
| 20 | Class1 myclass = new Class1; |
| 21 | |
| 22 | myclass.new Foo(); |
| 23 | return 0; |
| 24 | } |