diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/distinct/tdistinct.nim | 10 | ||||
-rw-r--r-- | tests/exception/texcpt1.nim | 15 |
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/distinct/tdistinct.nim b/tests/distinct/tdistinct.nim index d200b3e34..52728fc2b 100644 --- a/tests/distinct/tdistinct.nim +++ b/tests/distinct/tdistinct.nim @@ -75,3 +75,13 @@ block tconsts: type MyBoolArr = distinct array[3, bool] const barr:MyBoolArr = MyBoolArr([true, false, true]) + +# bug #2760 + +type + DistTup = distinct tuple + foo, bar: string + +const d: DistTup = DistTup(( + foo:"FOO", bar:"BAR" +)) diff --git a/tests/exception/texcpt1.nim b/tests/exception/texcpt1.nim index 50a95eeec..835f3610a 100644 --- a/tests/exception/texcpt1.nim +++ b/tests/exception/texcpt1.nim @@ -4,6 +4,8 @@ discard """ 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 +29,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 |