mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-02 16:11:08 +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* 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;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue