Bug 18951 – package static method masked by public static method in class
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2018-06-06T09:19:27Z
Last change time
2018-06-08T11:48:06Z
Keywords
pull
Assigned to
No Owner
Creator
FeepingCreature
Comments
Comment #0 by default_357-line — 2018-06-06T09:19:27Z
This issue arises as a result of the fix for issue 12511.
test/A.d:
module test.A;
public class Class
{
package static void foo(Object) {}
public static void foo() {}
}
test/B.d:
import test.A;
void main()
{
Class.foo(new Object);
}
test/B.d(4): Error: function test.A.Class.foo() is not callable using argument types (Object)
What happens is that the 12511 fix pulls up the public foo() because it's the most visible foo in Class. package foo, which is also perfectly visible from test.B, has a lower visibility and is thus ignored.