D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 18219 - Private import inside struct leaks symbols when used as VarDeclaration types
Summary: Private import inside struct leaks symbols when used as VarDeclaration types
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-10 08:40 UTC by RazvanN
Modified: 2021-04-03 01:03 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description RazvanN 2018-01-10 08:40:29 UTC
// 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.
Comment 1 RazvanN 2018-01-10 10:27:18 UTC
PR: https://github.com/dlang/dmd/pull/7668
Comment 2 github-bugzilla 2018-01-22 15:30:07 UTC
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
Comment 3 Dlang Bot 2021-04-03 01:03:38 UTC
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