www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13697] New: Private method hides public static method


          Issue ID: 13697
           Summary: Private method hides public static method
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andre s-e-a-p.de

Following code fails with errors:
class test.A member b is not accessible

module app;
import test;

void main()

module test;

class A
    private void b(){}
    static void b(string b){}

Comment from Jonathan M Davis (forum):

That looks like a bug. All you have to do is change the order of the two
function declarations or rename the non-static one to something else, and it
compiles. So, somehow, the fact that the non-static one has the same name as
the static one and the fact that it comes first screws up accessing the
static one. And explicitly marking the static one as public doesn't help.

Nov 07 2014