| 1 |
/* |
| 2 |
TEST_OUTPUT: |
| 3 |
--- |
| 4 |
fail_compilation/fail14965.d(19): Error: forward reference to inferred return type of function `foo1` |
| 5 |
fail_compilation/fail14965.d(20): Error: forward reference to inferred return type of function `foo2` |
| 6 |
fail_compilation/fail14965.d(22): Error: forward reference to inferred return type of function `bar1` |
| 7 |
fail_compilation/fail14965.d(23): Error: forward reference to inferred return type of function `bar2` |
| 8 |
fail_compilation/fail14965.d(25): Error: forward reference to inferred return type of function `baz1` |
| 9 |
fail_compilation/fail14965.d(26): Error: forward reference to inferred return type of function `baz2` |
| 10 |
fail_compilation/fail14965.d(30): Error: forward reference to inferred return type of function `foo1` |
| 11 |
fail_compilation/fail14965.d(31): Error: forward reference to inferred return type of function `foo2` |
| 12 |
fail_compilation/fail14965.d(33): Error: forward reference to inferred return type of function `bar1` |
| 13 |
fail_compilation/fail14965.d(34): Error: forward reference to inferred return type of function `bar2` |
| 14 |
fail_compilation/fail14965.d(36): Error: forward reference to inferred return type of function `baz1` |
| 15 |
fail_compilation/fail14965.d(37): Error: forward reference to inferred return type of function `baz2` |
| 16 |
--- |
| 17 |
*/ |
| 18 |
|
| 19 |
auto foo1() { alias F = typeof(foo1); } // TypeTypeof |
| 20 |
auto foo2() { alias FP = typeof(&foo2); } // TypeTypeof |
| 21 |
|
| 22 |
auto bar1() { auto fp = &bar1; } // ExpInitializer |
| 23 |
auto bar2() { auto fp = cast(void function())&bar2; } // castTo |
| 24 |
|
| 25 |
auto baz1() { return &baz1; } // ReturnStatement |
| 26 |
auto baz2() { (&baz2); } // ExpStatement |
| 27 |
|
| 28 |
class C |
| 29 |
{ |
| 30 |
auto foo1() { alias F = typeof(this.foo1); } |
| 31 |
auto foo2() { alias FP = typeof(&this.foo2); } |
| 32 |
|
| 33 |
auto bar1() { auto fp = &this.bar1; } |
| 34 |
auto bar2() { auto dg = cast(void delegate())&this.bar2; } |
| 35 |
|
| 36 |
auto baz1() { return &baz1; } |
| 37 |
auto baz2() { (&baz2); } |
| 38 |
} |