Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Issue 9268 - [ice-on-invalid] void assignment in fail44.d no longer caught in frontend #1434

Merged
merged 2 commits into from

2 participants

@9rnsr
Collaborator

Added "Internal error: " check in d_do_test.d

@donc donc merged commit 18e34e9 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 7, 2013
  1. @9rnsr
  2. @9rnsr
This page is out of date. Refresh to see the latest.
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
8 test/d_do_test.d
@@ -417,10 +417,14 @@ int main(string[] args)
}
}
+ compile_output = std.string.strip(compile_output);
+ compile_output = compile_output.unifyNewLine();
+
+ auto m = std.regex.match(compile_output, `Internal error: .*$`);
+ enforce(!m, m.hit);
+
if (testArgs.compileOutput !is null)
{
- compile_output = std.string.strip(compile_output);
- compile_output = compile_output.unifyNewLine();
compile_output = std.regex.replace(compile_output, regex(`DMD v2\.[0-9]+ DEBUG\n`, ""), "");
compile_output = std.regex.replace(compile_output, regex(`\nDMD v2\.[0-9]+ DEBUG`, ""), "");
enforce(compile_output == testArgs.compileOutput,
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];
}
Something went wrong with that request. Please try again.