gcc/testsuite/gdc.test/fail_compilation/fail17518.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail17518.d(21): Error: constructor `fail17518.S.this(inout(Correct) __param_0) inout` is not callable using argument types `(Wrong)` |
| 5 | fail_compilation/fail17518.d(21): cannot pass argument `Wrong()` of type `Wrong` to parameter `inout(Correct) __param_0` |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | struct S |
| 10 | { |
| 11 | this(inout Correct) inout |
| 12 | { |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | struct Correct {} |
| 17 | struct Wrong {} |
| 18 | |
| 19 | S bug() |
| 20 | { |
| 21 | return S(Wrong()); |
| 22 | } |