Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix Issue 9268 - [ice-on-invalid] void assignment in fail44.d no long…

…er caught in frontend
  • Loading branch information...
commit 97e936844677bedf0ab9a05739f63f843cddd155 1 parent e818024
@9rnsr 9rnsr authored
Showing with 12 additions and 5 deletions.
  1. +2 −2 src/expression.c
  2. +10 −3 test/fail_compilation/fail44.d
View
4 src/expression.c
@@ -10624,13 +10624,13 @@ Expression *AssignExp::semantic(Scope *sc)
Type *t1 = e1->type->toBasetype();
e2 = e2->inferType(t1);
- if (!e2->rvalue())
- return new ErrorExp();
e2 = e2->semantic(sc);
if (e2->op == TOKerror)
return new ErrorExp();
e2 = resolveProperties(sc, e2);
+ if (!e2->rvalue())
+ return new ErrorExp();
/* Rewrite tuple assignment as a tuple of assignments.
*/
View
13 test/fail_compilation/fail44.d
@@ -1,12 +1,19 @@
+/*
+TEST_OUTPUT:
+---
+fail_compilation/fail44.d(18): Error: expression bar[i] is void and has no value
+---
+*/
+
void Foo()
{
void[] bar;
void[] foo;
-
+
bar.length = 50;
foo.length = 50;
-
- for(int i=0; i<50; i++)
+
+ for(size_t i=0; i<50; i++)
{
foo[i] = bar[i];
}
Please sign in to comment.
Something went wrong with that request. Please try again.