www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4748] New: Shadowing declaration error in std.string.tolower

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: jmdavisProg gmail.com



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: -------
Aug 28 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4748


David Simcha <dsimcha yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dsimcha yahoo.com
         Resolution|                            |FIXED



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.

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