Thread overview
[Issue 12796] std.string toLower/toUpper array conversion.
May 24, 2014
Damian
Jun 11, 2014
Peter Alexander
May 24, 2014
https://issues.dlang.org/show_bug.cgi?id=12796

Damian <damianday@hotmail.co.uk> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|std.string toLower array    |std.string toLower/toUpper
                   |conversion.                 |array conversion.

--
May 24, 2014
https://issues.dlang.org/show_bug.cgi?id=12796

monarchdodra@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |monarchdodra@gmail.com

--- Comment #1 from monarchdodra@gmail.com ---
FYI, the ice issue is 12769 and fixed. https://issues.dlang.org/show_bug.cgi?id=12769

HEAD currently produces:

std/uni.d(8042): Error: template std.array.appender cannot deduce function from
argument types !(char[64])(char[]), candidates are:
std/array.d(2707):        std.array.appender(A : E[], E)()
std/array.d(2712):        std.array.appender(A : E[], E)(A array)
std/array.d(3025):        std.array.appender(A : E[]*, E)(A array)
std/uni.d(8377): Error: template instance std.uni.toCase!(toLowerIndex, 1043,
toLowerTab, char[64]) error instantiating
main.d(11):        instantiated from here: toLower!(char[64])

--
June 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12796

Peter Alexander <peter.alexander.au@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au@gmail.co
                   |                            |m

--- Comment #2 from Peter Alexander <peter.alexander.au@gmail.com> ---
(In reply to monarchdodra from comment #1)
> FYI, the ice issue is 12769 and fixed. https://issues.dlang.org/show_bug.cgi?id=12769
> 
> HEAD currently produces:
> 
> std/uni.d(8042): Error: template std.array.appender cannot deduce function
> from argument types !(char[64])(char[]), candidates are:
> std/array.d(2707):        std.array.appender(A : E[], E)()
> std/array.d(2712):        std.array.appender(A : E[], E)(A array)
> std/array.d(3025):        std.array.appender(A : E[]*, E)(A array)
> std/uni.d(8377): Error: template instance std.uni.toCase!(toLowerIndex,
> 1043, toLowerTab, char[64]) error instantiating
> main.d(11):        instantiated from here: toLower!(char[64])

Isn't that correct output? char[64] is not a range, so it shouldn't compile and you should need to write w1[].toLower.

Either way, you certainly can't put the result back into a char[64] because non-ASCII casing changes may alter length.

I propose this is closed.

--
June 11, 2014
https://issues.dlang.org/show_bug.cgi?id=12796

monarchdodra@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from monarchdodra@gmail.com ---
(In reply to Peter Alexander from comment #2)
> Isn't that correct output? char[64] is not a range, so it shouldn't compile and you should need to write w1[].toLower.

Absolutly.

> Either way, you certainly can't put the result back into a char[64] because non-ASCII casing changes may alter length.

That's another issue I guess.

> I propose this is closed.

It wasn't quite correct though in the sense that toLower failed to compile "internally". I fixed it when I submitted: https://github.com/D-Programming-Language/phobos/pull/2203

So now it correctly produces:
main.d(27): Error: None of the overloads of 'toLower' are callable using
argument types (char[64]), candidates are:
std/uni.d(7989):        std.uni.toLower(dchar c)
std/uni.d(8382):        std.uni.toLower(string s)
std/uni.d(8384):        std.uni.toLower(immutable(wchar)[] s)
std/uni.d(8386):        std.uni.toLower(immutable(dchar)[] s)

So *now* it is fixed, yes. Closing.

--