Fixed #41 — Casting Associative Arrays To Immutable

This commit is contained in:
Alexey Prokhin
2011-12-09 12:22:12 +04:00
parent 23947489f7
commit eb6809a530

View File

@@ -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();
}