www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18219] New: Private import inside struct leaks symbols when

https://issues.dlang.org/show_bug.cgi?id=18219

          Issue ID: 18219
           Summary: Private import inside struct leaks symbols when used
                    as VarDeclaration types
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: razvan.nitu1305 gmail.com

// 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.

--
Jan 10 2018