mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
29 lines
620 B
D
29 lines
620 B
D
// https://issues.dlang.org/show_bug.cgi?id=23384
|
|
|
|
/*
|
|
TEST_OUTPUT:
|
|
---
|
|
fail_compilation/diag23384.d(28): Error: function `diag23384.Derived.fun(B b)` is not callable using argument types `(A)`
|
|
fail_compilation/diag23384.d(28): Note: function `diag23384.Derived.fun` hides base class function `diag23384.Base.fun`
|
|
fail_compilation/diag23384.d(28): Add `alias fun = diag23384.Base.fun;` to `diag23384.Derived`'s body to merge the overload sets
|
|
---
|
|
*/
|
|
|
|
struct A {}
|
|
struct B {}
|
|
|
|
class Base
|
|
{
|
|
void fun(A a) {}
|
|
}
|
|
|
|
class Derived : Base
|
|
{
|
|
void fun(B b) {}
|
|
}
|
|
|
|
void main()
|
|
{
|
|
Derived d;
|
|
d.fun(A());
|
|
}
|