import std.string;
char[64] w1;
w1 = w1.toLower;
std\uni.d(6954): Error: e2ir: cannot cast result of type char[] to type char[64]
Comment #1 by monarchdodra — 2014-05-24T20:46:50Z
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])
Comment #2 by peter.alexander.au — 2014-06-11T19:51:17Z
(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.
Comment #3 by monarchdodra — 2014-06-11T21:26:32Z
(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.