mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-04-30 23:20:40 +03:00
Fix casting of associative arrays
This commit is contained in:
parent
f0a183f0e8
commit
aa5dfdfd4d
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue