On Thursday, 25 January 2024 at 15:03:41 UTC, Max Samukha wrote:
module-level. Consider:

```
synchronized class C
{
    private int x;
    private int y;

    invariant () { assert (x == y); }
}

void foo(C c)
{
    // mutate c
}
```

With module-level private, 'foo' is part of C's public interface, but it neither locks on c, nor runs the invariant checks. I personally have no idea how to fix that sensibly except by ditching class invariant/synchronized entirely.



`private to module `, goes against `consistency, completeness, and redundancy` pursued by D, just to maintain the `uniqueness` between `D and C++`!

Reply via email to