summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-09-03 01:35:45 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-09-03 01:35:45 +0200
commitdc67dd3bef80bec6f91961347ed3c45af7b2b5c9 (patch)
treef390d26024e3efcf5a51ecc72c82269337cbb98c /compiler/semstmts.nim
parent0d68ef9f1135e934e6b7af4d69fa6e4e5f61d15b (diff)
downloadNim-dc67dd3bef80bec6f91961347ed3c45af7b2b5c9.tar.gz
fixes #8028
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim2
1 files changed, 1 insertions, 1 deletions
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)])