Re: private selective import + overload = breaks accessibility rules

2018-01-17 Thread Seb via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 07:40:36 UTC, Joakim wrote: Are you sure about this? I thought such module-scope selective imports were supposed to be private by default since Martin's fixes for bug 314, which is why you submitted pull 5584. Bug 17630 is about something different, that

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread Joakim via Digitalmars-d-learn
On Wednesday, 17 January 2018 at 02:23:40 UTC, Seb wrote: On Tuesday, 16 January 2018 at 19:05:51 UTC, rumbu wrote: On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread Seb via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 19:05:51 UTC, rumbu wrote: On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be visible in module b. The latest compiler should emit a

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread rumbu via Digitalmars-d-learn
On Tuesday, 16 January 2018 at 18:32:46 UTC, H. S. Teoh wrote: Which version of the compiler is this? I'm pretty sure the std.math.isNaN imported by module a should not be visible in module b. The latest compiler should emit a deprecation warning for this. 2.078, but also 2.077.

Re: private selective import + overload = breaks accessibility rules

2018-01-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jan 16, 2018 at 06:13:27PM +, rumbu via Digitalmars-d-learn wrote: > module a; > > private import std.math: isNaN; > > //custom overload > public bool isNaN(int i) { return false; } > > > = > > module b; > import a; > > void foo() > { > bool b =

private selective import + overload = breaks accessibility rules

2018-01-16 Thread rumbu via Digitalmars-d-learn
module a; private import std.math: isNaN; //custom overload public bool isNaN(int i) { return false; } = module b; import a; void foo() { bool b = isNaN(float.nan); //compiles successfully calling std.math.isNaN even it should not be visible. } Is this