From aa5dfdfd4d86358c72e2d1d0cfbb0dc7d5726e0b Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Sun, 20 Feb 2011 19:00:54 +0300 Subject: [PATCH] Fix casting of associative arrays --- gen/llvmhelpers.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) 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;