blob: 4b4ebe44889ca0b9b2d8f81102c0529927660823 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
discard """
output: '''Hello
Hello
'''
"""
proc test[T]() =
try:
raise newException(T, "Hello")
except T as foobar:
echo(foobar.msg)
doAssert(not declared(foobar))
template testTemplate(excType: typedesc) =
try:
raise newException(excType, "Hello")
except excType as foobar:
echo(foobar.msg)
doAssert(not declared(foobar))
proc test2() =
testTemplate(Exception)
doAssert(not declared(foobar))
test[Exception]()
test2()
|