digitalmars.D.learn - Are selective imports supposed to always be public?
- tsbockman (12/12) Dec 06 2015 Why does this code compile? Shouldn't the `isIntegral` import be
- Mike Parker (3/15) Dec 06 2015 A very old bug.
- tsbockman (3/5) Dec 06 2015 Wow! 2006. Looks like it might get fixed soon, though:
- Jonathan M Davis via Digitalmars-d-learn (8/27) Dec 06 2015 Yeah. At this point, you should basically never use selective imports at...
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); }
Dec 06 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
Dec 06 2015
On Sunday, 6 December 2015 at 11:10:44 UTC, Mike Parker wrote:A very old bug. https://issues.dlang.org/show_bug.cgi?id=314Wow! 2006. Looks like it might get fixed soon, though: https://github.com/D-Programming-Language/dmd/pull/3407
Dec 06 2015
On Sunday, December 06, 2015 11:10:44 Mike Parker via Digitalmars-d-learn wrote:On Sunday, 6 December 2015 at 10:31:58 UTC, tsbockman wrote:Yeah. At this point, you should basically never use selective imports at the module-level. As I understand it, work has been done towards fixing this bug and some related bugs recently, but the compiler devs aren't in agreement on the changes. So, for the moment at least, the bug continues to be a problem, but there's a good chance that it'll get fixed semi-soon. - Jonathan M DavisWhy 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
Dec 06 2015