summary refs log tree commit diff stats
path: root/tests/effects/teffects2.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/effects/teffects2.nim')
-rw-r--r--tests/effects/teffects2.nim20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/effects/teffects2.nim b/tests/effects/teffects2.nim
new file mode 100644
index 000000000..7e6b17c36
--- /dev/null
+++ b/tests/effects/teffects2.nim
@@ -0,0 +1,20 @@
+discard """
+  line: 19
+  errormsg: "can raise an unlisted exception: ref EIO"
+"""
+
+type
+  TObj = object {.pure, inheritable.}
+  TObjB = object of TObj
+    a, b, c: string
+  
+  EIO2 = ref object of EIO
+  
+proc forw: int {.raises: [].}
+
+proc lier(): int {.raises: [EIO].} =
+  writeln stdout, "arg"
+
+proc forw: int =
+  raise newException(EIO, "arg")
+