digitalmars.D.bugs - implicit conversion of complex to real
- Ilya Zaitseff (14/14) Nov 18 2004 Why such conversion is allowed? I think it is a bug.
- Stewart Gordon (5/9) Nov 19 2004 There's no such thing as better or worse overloading matches in D.
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
Nov 18 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.
Nov 19 2004