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 
foo1()19 auto foo1() { alias F = typeof(foo1); }     // TypeTypeof
foo2()20 auto foo2() { alias FP = typeof(&foo2); }   // TypeTypeof
21 
bar1()22 auto bar1() { auto fp = &bar1; }            // ExpInitializer
bar2()23 auto bar2() { auto fp = cast(void function())&bar2; }   // castTo
24 
baz1()25 auto baz1() { return &baz1; }               // ReturnStatement
baz2()26 auto baz2() { (&baz2); }                    // ExpStatement
27 
28 class C
29 {
foo1()30     auto foo1() { alias F = typeof(this.foo1); }
foo2()31     auto foo2() { alias FP = typeof(&this.foo2); }
32 
bar1()33     auto bar1() { auto fp = &this.bar1; }
bar2()34     auto bar2() { auto dg = cast(void delegate())&this.bar2; }
35 
baz1()36     auto baz1() { return &baz1; }
baz2()37     auto baz2() { (&baz2); }
38 }
39