[Issue 21806] Overload selection ignores slice

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 7 08:49:57 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=21806

Dennis <dkorpel at live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dkorpel at live.nl
         Resolution|---                         |INVALID

--- Comment #2 from Dennis <dkorpel at live.nl> ---
This compilation output is correct.
https://dlang.org/spec/function.html#function-overloading

Both functions have match level 3: match with qualifier conversion.
That's because `in` makes the parameter `const`, so `ubyte[]` needs to be
converted to `const(ubyte)[]`. Then partial ordering determines
`const(ubyte)[16]` to be more specialized than `const(ubyte)[]`, so the fixed
size version is chosen.

--


More information about the Digitalmars-d-bugs mailing list