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

--- Comment #6 from Kenji Hara <[email protected]> ---
(In reply to Steven Schveighoffer from comment #4)
> However, I'll note that in other cases, the compiler prefers one over the
> other:
> 
> // both double[]
> auto arr = [1.0, 1.0f];
> auto arr2 = [1.0f, 1.0];
> 
> // both double
> auto x = true ? 1.0 : 1.0f;
> auto x2 = true ? 1.0f : 1.0;
> 
> same for uint vs. int

Yes, that's what I imagine. The type T deduction in:

 void f(T)(T x, T y) {}
 void main() { f(1.0, 1.0f); }

should be equivalent with:

 alias T = typeof(true ? 1.0 : 1.0f);

--

Reply via email to