mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-03 10:24:44 +00:00
Add template tests for #3691.
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user