gcc/testsuite/gdc.test/fail_compilation/test24365.d
raw| 1 | // https://issues.dlang.org/show_bug.cgi?id=243645 |
| 2 | |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | fail_compilation/test24365.d(16): Error: `f` cannot be interpreted at compile time, because it has no available source code |
| 7 | fail_compilation/test24365.d(14): compile time context created here |
| 8 | fail_compilation/test24365.d(19): while evaluating: `static assert(r == 2)` |
| 9 | --- |
| 10 | */ |
| 11 | |
| 12 | void main() |
| 13 | { |
| 14 | enum r = () { |
| 15 | void f(); |
| 16 | f(); |
| 17 | return 2; |
| 18 | }(); |
| 19 | static assert(r == 2); |
| 20 | } |