Are selective imports supposed to always be public?

Mike Parker via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 6 03:10:44 PST 2015


On Sunday, 6 December 2015 at 10:31:58 UTC, tsbockman wrote:
> Why does this code compile? Shouldn't the `isIntegral` import 
> be private to module `testB` unless I explicitly ask for it to 
> be public?
>
> // testB.d
> module testB;
>
> import std.traits : isIntegral;
>
> // testA.d
> module testA;
>
> void main(string[] args) {
>     import testB;
>     static assert(isIntegral!int);
> }

A very old bug.

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


More information about the Digitalmars-d-learn mailing list