Summary: Shadowing declaration error in std.string.tolower
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos

--- Comment #0 from Jonathan M Davis <> 2010-08-28 
19:04:42 PDT ---
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:

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.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to