Thread overview
Cross module conflict bug with private and public members?
Aug 22, 2015
Gary Willoughby
Aug 22, 2015
H. S. Teoh
Aug 22, 2015
Gary Willoughby
Aug 22, 2015
H. S. Teoh
Aug 22, 2015
Adam D. Ruppe
August 22, 2015
import std.stdio;
import std.range;
import std.concurrency;

void main(string[] args)
{
	auto generator = new Generator!(int)({
		foreach (value; 1..10)
		{
			yield(value);
		}
	});

	foreach (value; generator)
	{
		writeln(value);
	}
}

Compiled with `rdmd test.d`

test.d(41): Error: std.concurrency.Generator(T) at /usr/include/dmd/phobos/std/concurrency.d(1569) conflicts with std.range.Generator(Fun...) at /usr/include/dmd/phobos/std/rang
e/package.d(2806)

`std.concurrency.Generator` is public and `std.range.Generator` is private so surely these shouldn't conflict?
August 22, 2015
On Sat, Aug 22, 2015 at 01:47:30PM +0000, Gary Willoughby via Digitalmars-d wrote: [...]
> test.d(41): Error: std.concurrency.Generator(T) at
> /usr/include/dmd/phobos/std/concurrency.d(1569) conflicts with
> std.range.Generator(Fun...) at /usr/include/dmd/phobos/std/rang
> e/package.d(2806)
> 
> `std.concurrency.Generator` is public and `std.range.Generator` is private so surely these shouldn't conflict?

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


T

-- 
Nothing in the world is more distasteful to a man than to take the path that leads to himself. -- Herman Hesse
August 22, 2015
On Saturday, 22 August 2015 at 13:47:31 UTC, Gary Willoughby wrote:
> `std.concurrency.Generator` is public and `std.range.Generator` is private so surely these shouldn't conflict?

You would think so, but this is the way it has been since the beginning of D so I wouldn't expect the implementation to change any time soon. Just work around it with static+renamed imports or full name disambiguation.

https://issues.dlang.org/show_bug.cgi?id=1238
August 22, 2015
On Saturday, 22 August 2015 at 14:28:23 UTC, H. S. Teoh wrote:
> On Sat, Aug 22, 2015 at 01:47:30PM +0000, Gary Willoughby via Digitalmars-d wrote: [...]
>> test.d(41): Error: std.concurrency.Generator(T) at
>> /usr/include/dmd/phobos/std/concurrency.d(1569) conflicts with
>> std.range.Generator(Fun...) at /usr/include/dmd/phobos/std/rang
>> e/package.d(2806)
>> 
>> `std.concurrency.Generator` is public and `std.range.Generator` is private so surely these shouldn't conflict?
>
> https://issues.dlang.org/show_bug.cgi?id=1238
>
>
> T

Ah yes, I remember this one now. When is this ever going to get fixed?
August 22, 2015
On Sat, Aug 22, 2015 at 03:24:45PM +0000, Gary Willoughby via Digitalmars-d wrote:
> On Saturday, 22 August 2015 at 14:28:23 UTC, H. S. Teoh wrote:
> >On Sat, Aug 22, 2015 at 01:47:30PM +0000, Gary Willoughby via Digitalmars-d wrote: [...]
> >>test.d(41): Error: std.concurrency.Generator(T) at
> >>/usr/include/dmd/phobos/std/concurrency.d(1569) conflicts with
> >>std.range.Generator(Fun...) at /usr/include/dmd/phobos/std/rang
> >>e/package.d(2806)
> >>
> >>`std.concurrency.Generator` is public and `std.range.Generator` is private so surely these shouldn't conflict?
> >
> >https://issues.dlang.org/show_bug.cgi?id=1238
> >
> >
> >T
> 
> Ah yes, I remember this one now. When is this ever going to get fixed?

Who knows.  There was an original fix by Kenji that worked, but was reverted for various reasons.  Maybe if you clamor loud enough, the PTB may finally decide to do something about it.


T

-- 
People tell me that I'm skeptical, but I don't believe them.