[Issue 14802] Template argument deduction depends on order of arguments

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jul 16 07:36:56 PDT 2015


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

Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
           Hardware|x86_64                      |All
         Resolution|INVALID                     |---
                 OS|Linux                       |All

--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> ---
>From 2.066, IFTI is improved to support following case.

void foo(T)(T, T[] a) { pragma(msg, T); }
void main()
{
    short[] a;
    foo(1, a);  // prints 'short'
}

See also: https://issues.dlang.org/show_bug.cgi?id=12290

I think this issue is a part of the implemented enhancement.

At least, the order dependent behavior is a bug in D. Instead it should be
consistent result.

--


More information about the Digitalmars-d-bugs mailing list