www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18951] New: static package masked by static public in class

https://issues.dlang.org/show_bug.cgi?id=18951

          Issue ID: 18951
           Summary: static package masked by static public in class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

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.

--
Jun 06 2018