On Mon, 28 Nov 2011 09:40:06 +0200, Alexey Veselovsky <[email protected]> wrote:

Now, let's try this on D:

// Implementation
module test;

public {
    void foo() {foo_helper();}

    struct Boo
    {
    public:
        void boo() {S ss; foo_helper();}
    private:
        struct S {};
    }
}

private {
    struct HelperStruct {};
    void foo_helper() {HelperStruct s;}
}

// Specification (generated by dmd -H test.d -c) -- test.di file
// D import file generated from 'test.d'
module test;
public
{
    void foo() {foo_helper();}

    struct Boo
    {
        public
        {
            void boo() {S ss; foo_helper();}
            private struct S{}
        }
    }
}

private
{
    struct HelperStruct{}
    void foo_helper(){HelperStruct s;}
}

Usage:
import test;

void main() {
    foo();          // ok
    Boo b;          // ok
    b.boo();        // ok
    Boo.S ss;       // ok (wtf?)
    HelperStruct s; // ok (wtf?!)
}

You are right, i can't see anything that requires "not one" of those private stuff to be exposed.
This has to be a bug.

Reply via email to