toLower

ryuukk_ ryuukk.dev at gmail.com
Tue Aug 15 20:00:57 UTC 2023


On Tuesday, 15 August 2023 at 16:47:36 UTC, Joel wrote:
> How come toLower works in the sort quotes, but not in the map?
>
> ```d
> void main() {
>     import std;
>     "EzraTezla"
>         .to!(char[])
>         .byCodeUnit
>         .sort!"a.toLower<b.toLower"
>         .map!(c => c.toLower)
>         .writeln;
> }
> ```
>
> onlineapp.d(60): Error: `toLower` matches conflicting symbols:
> /dlang/dmd/linux/bin64/../../src/phobos/std/uni/package.d(9819):        function `std.uni.toLower`
> /dlang/dmd/linux/bin64/../../src/phobos/std/ascii.d(637):       
>  function `std.ascii.toLower!char.toLower`
> /dlang/dmd/linux/bin64/../../src/phobos/std/algorithm/iteration.d(479):        instantiated from here: `MapResult!(__lambda4, SortedRange!(ByCodeUnitImpl, "a.toLower>b.toLower", SortedRangeOptions.assumeSorted))`
> onlineapp.d(60):        instantiated from here: 
> `map!(SortedRange!(ByCodeUnitImpl, "a.toLower>b.toLower", 
> SortedRangeOptions.assumeSorted))`

This error message is unreadable, maybe an issue should be opened 
about it, so it could be improved, took me a while to understand, 
or rather "decipher", what it says..


More information about the Digitalmars-d-learn mailing list