Skip to content

Commit

Permalink
Merge pull request dlang#1479 from AndrejMitrovic/Fix9312
Browse files Browse the repository at this point in the history
Issue 9312 - With statement diagnostic is wrong
  • Loading branch information
9rnsr committed Jan 14, 2013
2 parents c55d4ef + 617c393 commit 6cfa082
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/statement.c
Original file line number Diff line number Diff line change
Expand Up @@ -4538,7 +4538,7 @@ Statement *WithStatement::semantic(Scope *sc)
sym->parent = sc->scopesym;
}
else
{ error("with expressions must be class objects, not '%s'", exp->type->toChars());
{ error("with expressions must be aggregate types, not '%s'", exp->type->toChars());
return NULL;
}
}
Expand Down
13 changes: 13 additions & 0 deletions test/fail_compilation/diag9312.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
TEST_OUTPUT:
---
fail_compilation/diag9312.d(10): Error: with expressions must be aggregate types, not 'int'
---
*/

void main()
{
with (1)
{
}
}

0 comments on commit 6cfa082

Please sign in to comment.