Is this a known issue in Phobos/DMD?

Jonathan M Davis jmdavisProg at gmx.com
Sat Jan 5 16:48:12 PST 2013


On Saturday, January 05, 2013 21:39:13 d coder wrote:
> 1. std.string is exposing "count" (and some other functions) from
> std.algorithm. I think this should be a bug since count is not listed as a
> method in the std.string documentation.

It's not a bug. It was added as a public import in std.string as part of the 
transition process for moving some functions between modules (I believe that 
count _used_ to be a function in std.string), and it _would_ have been removed 
already except that when it came time to remove it, Andrei didn't want to for 
fear of breaking code. So, it may or may not end up being removed at some 
point.

> 2. Now the function from std.algorithm that becomes visible, shadows the
> local argument count. Is this expected behavior? If not, has it already
> been reported as a bug? At the minimum I expect better error message here.

_That_ is definitely a bug. Symbols local to a module are supposed to have 
precedence over imported symbols, so there shouldn't be any symbol conflicts 
when using a symbol local to a module, and local variables have precedence 
over module-level symbols, so it's definitely broken if a local import causes 
conflicts with a local variable. I have no idea if it's been reported though. 
You'd have to search bugzilla:

http://d.puremagic.com/issues

- Jonathan M Davis


More information about the Digitalmars-d mailing list