From eb6809a5302a332363f84664702f7e709b2e780a Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Fri, 9 Dec 2011 12:22:12 +0400 Subject: [PATCH] =?UTF-8?q?Fixed=20#41=20=E2=80=94=20Casting=20Associative?= =?UTF-8?q?=20Arrays=20To=20Immutable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gen/llvmhelpers.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index 83ff6a72..e4790c22 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -775,7 +775,9 @@ DValue* DtoCast(Loc& loc, DValue* val, Type* to) else if (fromtype->ty == Tdelegate) { return DtoCastDelegate(loc, val, to); } - else { + else if (fromtype->ty == totype->ty) { + return val; + } else { error(loc, "invalid cast from '%s' to '%s'", val->getType()->toChars(), to->toChars()); fatal(); }