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

RazvanN <razvan.nitu1...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |razvan.nitu1...@gmail.com
         Resolution|---                         |WORKSFORME

--- Comment #1 from RazvanN <razvan.nitu1...@gmail.com> ---
Errors have been improved since then and you also get to see which part of the
constraint failed. I would consider that this is a satisfactory development
since this bug report was filed.

Sample:

void fun(T)(T)
if (is(T == int) || is(T == string))
{}

void fun(T)(T)
if (is(T == float))
{}

struct A {}

void main()
{
    fun!A(A());
}

yields:

onlineapp.d(13): Error: none of the overloads of template `onlineapp.fun` are
callable using argument types `!(A)(A)`
onlineapp.d(1):        Candidates are: `fun(T)(T)`
  with `T = A`
  must satisfy one of the following constraints:
`       is(T == int)
       is(T == string)`
onlineapp.d(5):                        `fun(T)(T)`
  with `T = A`
  must satisfy the following constraint:
`       is(T == float)`

This tells you exactly what failed.

--

Reply via email to