1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice14923.d(21): Error: function ice14923.parse (C a) is not callable using argument types (A)
5 fail_compilation/ice14923.d(21):        instantiated from here: bar!((b) => parse(b))
6 ---
7 */
8 
bar(alias fun)9 auto bar(alias fun)()
10 {
11     size_t counter;
12     scope(exit) counter++;
13 
14     Object a2;
15     if (auto ai = cast(A)a2) return fun(ai);
16     if (auto ai = cast(B)a2) return fun(ai);
17 }
18 
parse(C a)19 void parse(C a)
20 {
21     bar!(b => parse(b))();
22 }
23 
24 class A {}
25 
26 class C {}
27 
28 class B : C {}
29