[Issue 22132] New: Overload resolution bypasses visibility

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 20 06:39:10 UTC 2021


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 at puremagic.com
          Reporter: pro.mathias.lang at 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.

--


More information about the Digitalmars-d-bugs mailing list