diff --git a/dmd/statement.c b/dmd/statement.c index 95693022..9cc4cba7 100644 --- a/dmd/statement.c +++ b/dmd/statement.c @@ -4119,7 +4119,12 @@ void Catch::semantic(Scope *sc) type = new TypeIdentifier(0, Id::Object); type = type->semantic(loc, sc); if (!type->toBasetype()->isClassHandle()) - error(loc, "can only catch class objects, not '%s'", type->toChars()); + { + if (type != Type::terror) + { error(loc, "can only catch class objects, not '%s'", type->toChars()); + type = Type::terror; + } + } else if (ident) { var = new VarDeclaration(loc, type, ident, NULL);