mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-12 02:43:14 +01: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* 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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user