www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cross module conflict bug with private and public members?

reply "Gary Willoughby" <dev nomad.so> writes:
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?
Aug 22 2015
next sibling parent reply "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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
Aug 22 2015
parent reply "Gary Willoughby" <dev nomad.so> writes:
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?
Aug 22 2015
parent "H. S. Teoh via Digitalmars-d" <digitalmars-d puremagic.com> writes:
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.
Aug 22 2015
prev sibling parent "Adam D. Ruppe" <destructionator gmail.com> writes:
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
Aug 22 2015