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..777a4cebc
--- /dev/null
+++ b/tests/effects/teffects2.nim
@@ -0,0 +1,20 @@
+discard """
+  errormsg: "can raise an unlisted exception: ref IOError"
+  line: 19
+"""
+{.push warningAsError[Effect]: on.}
+type
+  TObj {.pure, inheritable.} = object
+  TObjB = object of TObj
+    a, b, c: string
+
+  EIO2 = ref object of IOError
+
+proc forw: int {.raises: [].}
+
+proc lier(): int {.raises: [IOError].} =
+  writeLine stdout, "arg"
+
+proc forw: int =
+  raise newException(IOError, "arg")
+{.pop.}