| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail12236.d(16): Error: forward reference to inferred return type of function `f1` |
| 5 |
fail_compilation/fail12236.d(16): while evaluating `pragma(msg, f1.mangleof)` |
| 6 |
fail_compilation/fail12236.d(21): Error: forward reference to inferred return type of function `f2` |
| 7 |
fail_compilation/fail12236.d(21): while evaluating `pragma(msg, f2(T)(T).mangleof)` |
| 8 |
fail_compilation/fail12236.d(27): Error: template instance `fail12236.f2!int` error instantiating |
| 9 |
fail_compilation/fail12236.d(31): Error: forward reference to inferred return type of function `__lambda_L29_C5` |
| 10 |
fail_compilation/fail12236.d(31): while evaluating `pragma(msg, __lambda_L29_C5(__T1)(a).mangleof)` |
| 11 |
--- |
| 12 |
*/ |
| 13 |
|
| 14 |
auto f1(int) |
| 15 |
{ |
| 16 |
pragma(msg, f1.mangleof); // forward reference error |
| 17 |
} |
| 18 |
|
| 19 |
auto f2(T)(T) |
| 20 |
{ |
| 21 |
pragma(msg, f2.mangleof); // error <- weird output: "v" |
| 22 |
} |
| 23 |
|
| 24 |
void main() |
| 25 |
{ |
| 26 |
f1(1); |
| 27 |
f2(1); |
| 28 |
|
| 29 |
(a) { |
| 30 |
int x; |
| 31 |
pragma(msg, __traits(parent, x).mangleof); |
| 32 |
} (1); |
| 33 |
} |