November 19, 2004
Why such conversion is allowed? I think it is a bug.

Moreover, it prevents overloading.
At least, give to conversion to complex types more priority.

<cfloat_sqrt.d>
import std.math;

void foo(float a) {}
void foo(creal a) {}

void main()
{
  cfloat a;
  cfloat b = sqrt(a);
}

cfloat_sqrt.d(9): function std.math.sqrt overloads float(float) and creal(creal z) both match argument list for sqrt
November 19, 2004
Ilya Zaitseff wrote:
> Why such conversion is allowed? I think it is a bug.
> 
> Moreover, it prevents overloading.
> At least, give to conversion to complex types more priority.

There's no such thing as better or worse overloading matches in D. There are exact matches, implicit conversion matches and non-matches.

We need to turn this into a non-match.

Stewart.