// a.d class Foobar { int a; this(int a) { this.a = a; } static int smeth() { return 1; } } void fun() {} // b.d struct AST { import a; } // c.d void main() { import b; AST.Foobar t; // compiles AST.Foobar.smeth(); // does not compile AST.fun(); // does not compile } `AST.Foobar t` should not compile.
PR: https://github.com/dlang/dmd/pull/7668
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/9bcb80a1aff7ab3aab11b64115621220a2771753 Fix Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types https://github.com/dlang/dmd/commit/1018db023831a8c348bb8f9121b08fabb6e32fc2 Merge pull request #7668 from RazvanN7/Lookup Fix Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types
dlang/dmd pull request #12350 "[dmd-cxx] More fixes for package import visibility" was merged into dmd-cxx: - 3f2b5129622e51eb3108b440475cb1112ec45c0b by RazvanN7: [dmd-cxx] Fix Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types https://github.com/dlang/dmd/pull/12350