Thread overview
[Issue 13340] Improve error message for overload resolution error
Mar 29, 2021
Nicholas Wilson
Dec 17, 2022
Iain Buclaw
Dec 27, 2022
Nick Treleaven
[Issue 13340] Improve error message for overload resolution error with rvalue
Dec 27, 2022
Nick Treleaven
March 29, 2021
https://issues.dlang.org/show_bug.cgi?id=13340

Nicholas Wilson <iamthewilsonator@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |iamthewilsonator@hotmail.co
                   |                            |m

--- Comment #1 from Nicholas Wilson <iamthewilsonator@hotmail.com> ---
That second `void f()` should be called something different. Renaming it yields

onlineapp.d(20): Error: template `onlineapp.x` cannot deduce function from
argument types `!()(S)`, candidates are:
onlineapp.d(11):        `x(T)(T value)`
  with `T = S`
  must satisfy the following constraint:
`       !is(T == struct)`
onlineapp.d(14):        `x(T)(ref T value)

_even with_ -preview=rvaluerefparam

so it seems this issue should be closed and another one opened for the fact that this still doesn't compile?

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13340

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
December 27, 2022
https://issues.dlang.org/show_bug.cgi?id=13340

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #2 from Nick Treleaven <nick@geany.org> ---
> That second `void f()` should be called something different

Yes.

> so it seems this issue should be closed and another one opened for the fact that this still doesn't compile?

It can't compile because the first x overload doesn't take a struct, and the second one doesn't take an rvalue. So this issue is valid.

--
December 27, 2022
https://issues.dlang.org/show_bug.cgi?id=13340

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Improve error message for   |Improve error message for
                   |overload resolution error   |overload resolution error
                   |                            |with rvalue

--