Add template tests for #3691.

This commit is contained in:
Dominik Picheta
2017-02-06 19:25:09 +01:00
parent 4661ae22dd
commit e01c3561dc

View File

@@ -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()