From dc67dd3bef80bec6f91961347ed3c45af7b2b5c9 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 3 Sep 2018 01:35:45 +0200 Subject: [PATCH] fixes #8028 --- compiler/semstmts.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 425bb24dc..fb01127fc 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -804,7 +804,7 @@ proc semRaise(c: PContext, n: PNode): PNode = if not isImportedException(typ, c.config): if typ.kind != tyRef or typ.lastSon.kind != tyObject: localError(c.config, n.info, errExprCannotBeRaised) - if not isException(typ.lastSon): + if typ.len > 0 and not isException(typ.lastSon): localError(c.config, n.info, "raised object of type $1 does not inherit from Exception", [typeToString(typ)])