That said, instead of making the static array vary in length, you can make the dynamic array vary:
```D
immutable s4 = [1, 2, 3, 4];
foreach (i; [1, 4])
{
    auto ex = collectException(s4[0 .. i].to!(int[2]));
        assert(ex && ex.msg == "Length mismatch when converting to static array: 2 vs " ~ [cast(char)(i + '0')],
            ex ? ex.msg : "Exception was not thrown!");
}
```
Avoids 2 extra template instantiations to boot.

Speaking of which, I'm wondering if something a bit more like:
```D
T toImpl(T, S)(S value)
{
    static if (isStaticArray!T)
    {
        alias E = ElementEncodingType!T;
        auto res = to!(E[])(value);
        enforceEx!ConvException(T.length == res.length, "blablabla");
        return rest[0 .. T.length];
    }
    else
    {
        //Old generic dynamic array code.
    }
}
```
It should avoid needless duplication of template code that doesn't actually depend on the static array's length.

But that'd really be the icing on the cherry on the cake. I'm not even sure it's worth the added cost of maintenance in terms of complexity...