Merge pull request #182 from jerro/upstream-master

Casts between vector types.
This commit is contained in:
David Nadlinger
2012-10-05 14:21:35 -07:00

View File

@@ -809,6 +809,10 @@ DValue* DtoCastVector(Loc& loc, DValue* val, Type* to)
return new DImValue(to, array);
}
}
else if (totype->ty == Tvector && to->size() == val->getType()->size())
{
return new DImValue(to, DtoBitCast(val->getRVal(), tolltype));
}
else
{
error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars());