I'm trying to 'hide' a type, so as not to see it outside its module. I want to control the way it's created and used.

I know of Voldemort types and '@disable this', but for now I'm just trying to use 'private'. Halas, it seems it can be circumvented:

*********

module A;

private struct Hidden {}

Hidden foo() { return Hidden();}

*********

module B;

import A;

void main() {
    typeof(foo()) h;
}

*********

Am I misunderstanding something or is that a bug?

Reply via email to