Skip to content

Commit

Permalink
Merge pull request #3030 from 9rnsr/fix14233
Browse files Browse the repository at this point in the history
[REG2.067b2] Issue 14233 - Can't build Algebraic!(This[]) anymore
  • Loading branch information
WalterBright committed Mar 4, 2015
2 parents b345d95 + fcc1aab commit 23702b2
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions std/variant.d
Expand Up @@ -481,7 +481,7 @@ private:
static if (!is(Unqual!(typeof((*zis)[0])) == void) && is(typeof((*zis)[0])) && is(typeof((*zis) ~= *zis)))
{
// array type; parm is the element to append
auto arg = cast(VariantN*) parm;
auto arg = cast(Variant*) parm;
alias E = typeof((*zis)[0]);
if (arg[0].convertsTo!(E))
{
Expand Down Expand Up @@ -1107,7 +1107,7 @@ public:
///ditto
VariantN opCatAssign(T)(T rhs)
{
auto toAppend = VariantN(rhs);
auto toAppend = Variant(rhs);
fptr(OpID.catAssign, &store, &toAppend) == 0 || assert(false);
return this;
}
Expand Down Expand Up @@ -1299,6 +1299,15 @@ unittest
assert(aa["b"] == 3);
}

// Issue #14233
unittest
{
alias Atom = Algebraic!(string, This[]);

Atom[] values = [];
auto a = Atom(values);
}

pure nothrow @nogc
unittest
{
Expand Down

0 comments on commit 23702b2

Please sign in to comment.