Fix casting of associative arrays; thanks to alexey

This commit is contained in:
Moritz Warning
2011-02-24 13:08:36 +01:00
parent fb418bf2e6
commit 8275ffeb98

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;