www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14802] New: Template argument deduction depends on order of

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

          Issue ID: 14802
           Summary: Template argument deduction depends on order of
                    arguments
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: timokhin.iv gmail.com

Template argument deduction from several identical parameters may depend on
order of the arguments.

test.d
----
void f(T)(T x, T y)
{
    pragma(msg, T);
}

void main()
{
    f(1.0, 1.0f);
    f(1.0f, 1.0);
}
----

$ dmd test.d
float
double

--
Jul 15 2015