Debian Codegraph @

gcc/testsuite/gdc.test/fail_compilation/diag23384.d

raw
1 // https://issues.dlang.org/show_bug.cgi?id=23384
2
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/diag23384.d(28): Error: function `diag23384.Derived.fun(B b)` is not callable using argument types `(A)`
7 fail_compilation/diag23384.d(28): function `diag23384.Derived.fun` hides base class function `diag23384.Base.fun`
8 fail_compilation/diag23384.d(28): add `alias fun = diag23384.Base.fun` to `diag23384.Derived`'s body to merge the overload sets
9 ---
10 */
11
12 struct A {}
13 struct B {}
14
15 class Base
16 {
17 void fun(A a) {}
18 }
19
20 class Derived : Base
21 {
22 void fun(B b) {}
23 }
24
25 void main()
26 {
27 Derived d;
28 d.fun(A());
29 }