Skip to content

Commit

Permalink
Merge pull request #2190 from 9rnsr/fix10382
Browse files Browse the repository at this point in the history
[REG2.059] Issue 10382 - ICE when catching illegal type
  • Loading branch information
WalterBright committed Jun 17, 2013
2 parents 8a49ef8 + a80d289 commit 1f0af1f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/statement.c
Expand Up @@ -4558,9 +4558,6 @@ Catch *Catch::syntaxCopy()

void Catch::semantic(Scope *sc)
{
if (type && type->deco)
return;

//printf("Catch::semantic(%s)\n", ident->toChars());

#ifndef IN_GCC
Expand Down
15 changes: 15 additions & 0 deletions test/fail_compilation/ice10382.d
@@ -0,0 +1,15 @@
/*
TEST_OUTPUT:
---
fail_compilation/ice10382.d(14): Error: can only catch class objects derived from Throwable, not 'int'
---
*/

void main ()
{
try
{
int b = 3;
}
catch (int a) { }
}

0 comments on commit 1f0af1f

Please sign in to comment.