diff options
-rw-r--r-- | tests/exception/texcas.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/exception/texcas.nim b/tests/exception/texcas.nim index dfbed8f46..627b36632 100644 --- a/tests/exception/texcas.nim +++ b/tests/exception/texcas.nim @@ -10,15 +10,16 @@ proc test[T]() = echo(foobar.msg) doAssert(not declared(foobar)) -template testTemplate() = +template testTemplate(excType: typedesc) = try: - raise newException(Exception, "Hello") - except Exception as foobar: + raise newException(excType, "Hello") + except excType as foobar: echo(foobar.msg) doAssert(not declared(foobar)) proc test2() = - testTemplate() + testTemplate(Exception) doAssert(not declared(foobar)) test[Exception]() +test2() \ No newline at end of file |