Bug exposed while looking at issue 21351 imp.d ------------------ struct A { int x; } struct B { import imp : A; } // imports are private by default private struct P { } test.d ------------------ import imp; void main() { B.A; with (B) { A(0); } with (B()) { A(0); } imp.P(); with (imp) { P(); } } The above code fails with the following output: test.d(5): Error: no property A for type imp.B test.d(6): Error: no property A for type imp.B test.d(7): Error: cannot implicitly convert expression __withSym of type B* to int test.d(9): Error: undefined identifier P in module imp test.d(10): Error: P() has no effect Note that lines 7 and 10 should fail with same error as theirs respective forms without 'with' statement because the symbols A and P are private.
@BorisCarvajal created dlang/dmd pull request #11918 "Fix Issue 21353 - 'With()' statement ignores symbol visibility in som…" fixing this issue: - Fix Issue 21353 - 'With()' statement ignores symbol visibility in some cases https://github.com/dlang/dmd/pull/11918
dlang/dmd pull request #11918 "Fix Issue 21353 - 'With()' statement ignores symbol visibility in som…" was merged into stable: - 49b60b00c55766514f834d3defc54ce45c0d4ede by Boris Carvajal: Fix Issue 21353 - 'With()' statement ignores symbol visibility in some cases https://github.com/dlang/dmd/pull/11918
dlang/dmd pull request #11961 "merge stable" was merged into master: - 71d49af154297b4c4cab2e2b61b2bcd1c29bdf81 by Boris Carvajal: Fix Issue 21353 - 'With()' statement ignores symbol visibility in some cases https://github.com/dlang/dmd/pull/11961
dlang/dmd pull request #12125 "[dmd-cxx] Fix Issue 21353 - 'with()' statement ignores symbol visibility in some cases" was merged into dmd-cxx: - 64a7adac3ba982a5bee7f3902b7aa27a737d697f by Boris Carvajal: [dmd-cxx] Fix Issue 21353 - 'with()' statement ignores symbol visibility in some cases https://github.com/dlang/dmd/pull/12125