Add template tests for #3691.

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

View file

@ -10,15 +10,16 @@ proc test[T]() =
echo(foobar.msg) echo(foobar.msg)
doAssert(not declared(foobar)) doAssert(not declared(foobar))
template testTemplate() = template testTemplate(excType: typedesc) =
try: try:
raise newException(Exception, "Hello") raise newException(excType, "Hello")
except Exception as foobar: except excType as foobar:
echo(foobar.msg) echo(foobar.msg)
doAssert(not declared(foobar)) doAssert(not declared(foobar))
proc test2() = proc test2() =
testTemplate() testTemplate(Exception)
doAssert(not declared(foobar)) doAssert(not declared(foobar))
test[Exception]() test[Exception]()
test2()