Bug 4748 – Shadowing declaration error in std.string.tolower

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-08-28T19:04:00Z
Last change time
2010-09-04T08:24:26Z
Assigned to
nobody
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2010-08-28T19:04:42Z
I get the following error when using tolower(): /path/to/src/phobos/std/string.d(775): Error: shadowing declaration std.string.tolower!(immutable(dchar[])).tolower.c is deprecated /path/tosrc/phobos/std/string.d(887): Error: template instance std.string.tolower!(immutable(dchar[])) error instantiating datetime.d(6652): instantiated from here: monthOfYearFromString!(immutable(dchar[])) unittests.d(67): instantiated from here: fromSimpleString!(string) datetime.d(6652): Error: template instance datetime.monthOfYearFromString!(immutable(dchar[])) error instantiating unittests.d(67): instantiated from here: fromSimpleString!(string) tolower appears to be broken with dmd 2.048. Looking at the code, it looks like essentially what's happening in that there's a foreach within a foreach, and they both declare dchar c for the loop variable. Looking at the unit tests, they should have caught this, but either they didn't or the phobos in dmd 2.048 was released without passing all of its unit tests. In any case, it should be a trivial fix, but it means that if I want to use tolower, I have to patch it on my box, which obviously shouldn't be necessary. At least it should be a quick and obvious fix for anyone with commit prvileges.
Comment #1 by dsimcha — 2010-09-04T08:24:26Z
http://dsource.org/projects/phobos/changeset/1954 Though I still can't figure out for the life of me how this worked before on UTF-8 strings.