Add template tests for #3691.
This commit is contained in:
parent
4661ae22dd
commit
e01c3561dc
1 changed files with 5 additions and 4 deletions
|
|
@ -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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue