www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22132] New: Overload resolution bypasses visibility

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

          Issue ID: 22132
           Summary: Overload resolution bypasses visibility
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

Test case consist of two files, `moda.d` and `modb.d`:
```D
module moda;
private void func (int a) {}
public  void func (int a, string b) {}
```

```D
module modb;
import moda;
void main ()
{
    func(42);
}
```

Compiled with `dmd moda.d modb.d`, it should complain about no overload match,
but doesn't. Additionally, when the argument(s) are mismatched, both overloads
show as candidates.

--
Jul 19 2021