MATCH: Improve `A CMP 0 ? A : -A` set of patterns to use bitwise_equal_p.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / ice14923.d
blobe3b677e2cdb3d31c1adc861e71e1a591f27fcf2c
1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ice14923.d(22): Error: function `ice14923.parse(C a)` is not callable using argument types `(A)`
5 fail_compilation/ice14923.d(22): cannot pass argument `b` of type `ice14923.A` to parameter `C a`
6 fail_compilation/ice14923.d(22): instantiated from here: `bar!((b) => parse(b))`
7 ---
8 */
10 auto bar(alias fun)()
12 size_t counter;
13 scope(exit) counter++;
15 Object a2;
16 if (auto ai = cast(A)a2) return fun(ai);
17 if (auto ai = cast(B)a2) return fun(ai);
20 void parse(C a)
22 bar!(b => parse(b))();
25 class A {}
27 class C {}
29 class B : C {}