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

Paul Backus <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Paul Backus <[email protected]> ---
I'm pretty sure this is impossible. IFTI always infers parameter types from
argument types, not the other way around.

The best workaround is probably to use std.array.staticArray to convert the
array literal to the correct type:

---
struct S
{
    this(int[3] a){}
}

unittest
{
    auto s0 = S([1,2,3]); //OK
    import std.conv : emplace;
    import std.array : staticArray;
    auto s1 = emplace!S(&s0, staticArray([1,2,3])); //OK
}
---

--

Reply via email to