mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-17 21:33:13 +01:00
Fixed #41 — Casting Associative Arrays To Immutable
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user