[Issue 4748] New: Shadowing declaration error in std.string.tolower

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 28 19:04:54 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4748

           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
        AssignedTo: nobody at puremagic.com
        ReportedBy: jmdavisProg at gmail.com


--- Comment #0 from Jonathan M Davis <jmdavisProg at gmail.com> 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:
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list