Bug 19080 – Order of overloads affects the chosen method
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-07-12T09:27:11Z
Last change time
2024-02-11T20:18:24Z
Assigned to
No Owner
Creator
RazvanN
Comments
Comment #0 by razvan.nitu1305 — 2018-07-12T09:27:11Z
//a.d
struct Foo
{
private void fun(A)(A a) {}
void fun(int a) {}
}
struct Bar
{
void fun(int a) {}
private void fun(A)(A a) {}
}
// b.d
void main()
{
Foo a;
a.fun(42); // deprecation: a.Foo.fun is no visible
Bar b;
b.fun(42); // ok
}
Expectation : no deprecation at all
Comment #1 by razvan.nitu1305 — 2018-07-12T10:27:16Z
(In reply to RazvanN from comment #0)
> //a.d
> struct Foo
> {
> private void fun(A)(A a) {}
> void fun(int a) {}
> }
>
> struct Bar
> {
> void fun(int a) {}
> private void fun(A)(A a) {}
> }
>
> // b.d
I forgot add here: import a.d
> void main()
> {
> Foo a;
> a.fun(42); // deprecation: a.Foo.fun is no visible
> Bar b;
> b.fun(42); // ok
> }
>
> Expectation : no deprecation at all
Comment #2 by ibuclaw — 2024-02-11T20:17:55Z
Pretty sure this is a duplicate of issue 3254
Comment #3 by ibuclaw — 2024-02-11T20:18:24Z
*** This issue has been marked as a duplicate of issue 3254 ***