From e01c3561dc6ed08cd6c34a29d12c4c9951840f4b Mon Sep 17 00:00:00 2001 From: Dominik Picheta Date: Mon, 6 Feb 2017 19:25:09 +0100 Subject: [PATCH] Add template tests for #3691. --- tests/exception/texcas.nim | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/exception/texcas.nim b/tests/exception/texcas.nim index dfbed8f467..627b36632d 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