private method callable from other module

kdevel kdevel at vogtner.de
Sat Oct 8 09:46:59 UTC 2022


Is this a known bug?

```
// file b.d
import std.stdio;

struct S {
    private void foo (ubyte c)
    {
       writeln (__PRETTY_FUNCTION__);
    }
    void foo ()
    {
    }
}
```

```a.d
// file a.d
unittest {
    import b;
    auto s = S ();
    s.foo ('x');
}
```

```
$ dmd -g -unittest -main a.d b.d
$ ./a
void b.S.foo(ubyte c)
1 modules passed unittests
```


More information about the Digitalmars-d-learn mailing list