diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 47c4f4ec..d674bdb0 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -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;