[Issue 22792] Wrong inference of opApply
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Feb 20 12:02:11 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=22792
moonlightsentinel at disroot.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |moonlightsentinel at disroot.o
| |rg
--- Comment #1 from moonlightsentinel at disroot.org ---
> The function on the const one that matches better should be called.
Neither of the string opApply's is an exact match due to the const missmatch on
`this` or the delegate parameter => "match with implicit conversions". Partial
ordering then selects the mutable overload because it is "more specialized"
(cannot be called by the const overload).
Not sure why the int overloads expose a different behaviour.
See https://dlang.org/spec/function.html#function-overloading
--
More information about the Digitalmars-d-bugs
mailing list