gcc/testsuite/gdc.test/fail_compilation/ice10212.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/ice10212.d(13): Error: expected return type of `int`, not `int function() pure nothrow @nogc @safe`: |
| 5 | fail_compilation/ice10212.d(13): Return type of `int` inferred here. |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | int delegate() foo() |
| 10 | { |
| 11 | // returns "int function() pure nothrow @safe function() pure nothrow @safe" |
| 12 | // and it mismatches to "int delegate()" |
| 13 | return () => () { |
| 14 | return 1; |
| 15 | }; |
| 16 | } |