Hi, I've been trying to reduce a bug in the containers (8824).

From the example below it seems the dup method is passing the constructor
an array of dchars and the template is failing.

Is this a compiler bug, or ?

import std.range, std.traits;

struct Array2(T)
{
    private T[] _payload;

    size_t insertAt(R)(size_t index, R rng)
if (isInputRange!R && isImplicitlyConvertible!(ElementType!R, T))
    {
        return 0;
    }

    this(U)(U[] values...)
        if (isImplicitlyConvertible!(U, T))
    {
        insertAt(0, values);
    }

    @property Array2 dup()
    {
        return Array2(_payload);
    }
}

unittest
{
    Array2!int a; //passes
    Array2!char a; //fails
}

Reply via email to