mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-04-18 01:39:03 +02:00
Fix casting of associative arrays
This commit is contained in:
@@ -742,6 +742,14 @@ DValue* DtoCast(Loc& loc, DValue* val, Type* to)
|
|||||||
{
|
{
|
||||||
Type* fromtype = val->getType()->toBasetype();
|
Type* fromtype = val->getType()->toBasetype();
|
||||||
Type* totype = to->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))
|
if (fromtype->equals(totype))
|
||||||
return val;
|
return val;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user