summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorcooldome <ariabushenko@bk.ru>2018-06-10 22:49:09 +0100
committercooldome <ariabushenko@bk.ru>2018-06-10 22:49:09 +0100
commit7302a8ce7a0cc566c098b29fdb73c5da3b8e6ac0 (patch)
tree071c466a780b598876525f3799b5e5a9e3fdd7d2 /tests
parent03653ab61e6eed6811c5df0677a2bf2aa722ef9c (diff)
downloadNim-7302a8ce7a0cc566c098b29fdb73c5da3b8e6ac0.tar.gz
Fixes 7845
Diffstat (limited to 'tests')
-rw-r--r--tests/exception/texcpt1.nim16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/exception/texcpt1.nim b/tests/exception/texcpt1.nim
index 50a95eeec..ebbb9d44f 100644
--- a/tests/exception/texcpt1.nim
+++ b/tests/exception/texcpt1.nim
@@ -1,9 +1,12 @@
 discard """
   outputsub: "-6"
+  targets: "c cpp"
 """
 type
   ESomething = object of Exception
   ESomeOtherErr = object of Exception
+  ESomethingGen[T] = object of Exception
+  ESomethingGenRef[T] = ref object of Exception
 
 proc genErrors(s: string) =
   if s == "error!":
@@ -27,4 +30,17 @@ proc blah(): int =
 
 echo blah()
 
+# Issue #7845, raise generic exception
+var x: ref ESomethingGen[int]
+new(x)
+try:
+  raise x
+except ESomethingGen[int] as e:
+  discard
 
+try:
+  raise new(ESomethingGenRef[int])
+except ESomethingGenRef[int] as e:
+  discard
+except:
+  discard
\ No newline at end of file