www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13134] New: Lexically first `private` function overload makes

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

          Issue ID: 13134
           Summary: Lexically first `private` function overload makes all
                    overloads `private`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

This code should compile:
---
module foo;

// void f(int,int) { } // uncomment to remove error
private void f(int) { }
void f() { }
---
import foo;

void main()
{
    f();
}
---
main.d(5): Error: module main function foo.f is private
---

--
Jul 15 2014