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