gcc/testsuite/gdc.test/fail_compilation/fail99.d
raw| 1 | /* |
| 2 | TEST_OUTPUT: |
| 3 | --- |
| 4 | fail_compilation/fail99.d(13): Error: delegate `dg` is not callable using argument types `()` |
| 5 | fail_compilation/fail99.d(13): too few arguments, expected 1, got 0 |
| 6 | --- |
| 7 | */ |
| 8 | |
| 9 | //import std.stdio; |
| 10 | |
| 11 | void foo(void delegate(int) dg) |
| 12 | { |
| 13 | dg(); |
| 14 | //writefln("%s", dg(3)); |
| 15 | } |
| 16 | |
| 17 | void main() |
| 18 | { |
| 19 | foo(delegate(int i) |
| 20 | { |
| 21 | //writefln("i = %d\n", i); |
| 22 | } |
| 23 | ); |
| 24 | } |