Permalink
Browse files

Merge pull request #1755 from ibuclaw/error_array2int

Cast T[] to integral type: deprecation -> error.
  • Loading branch information...
2 parents 41ca264 + 43bea6b commit 0442749f02c9973b4aa19910374be30f2ac21823 @WalterBright WalterBright committed Mar 22, 2013
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/expression.c
View
@@ -9195,7 +9195,10 @@ Expression *CastExp::semantic(Scope *sc)
}
if (tob->isintegral() && t1b->ty == Tarray)
- deprecation("casting %s to %s is deprecated", e1->type->toChars(), to->toChars());
+ {
+ error("cannot cast %s to integral type %s", e1->toChars(), to->toChars());
+ return new ErrorExp();
+ }
if (tob->ty == Tpointer && t1b->ty == Tdelegate)
deprecation("casting from %s to %s is deprecated", e1->type->toChars(), to->toChars());

0 comments on commit 0442749

Please sign in to comment.