Fix casting of associative arrays

This commit is contained in:
Alexey Prokhin 2011-02-20 19:00:54 +03:00
parent f0a183f0e8
commit aa5dfdfd4d

View file

@ -742,6 +742,14 @@ DValue* DtoCast(Loc& loc, DValue* val, Type* to)
{
Type* fromtype = val->getType()->toBasetype();
Type* totype = to->toBasetype();
#if DMDV2
if (fromtype->ty == Taarray)
fromtype = ((TypeAArray*)fromtype)->getImpl()->type;
if (totype->ty == Taarray)
totype = ((TypeAArray*)totype)->getImpl()->type;
#endif
if (fromtype->equals(totype))
return val;