mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-28 01:21:40 +00:00
WIP: as with generics.
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
discard """
|
||||
output: '''Hello'''
|
||||
"""
|
||||
proc test[T]() =
|
||||
try:
|
||||
raise newException(T, "Hello")
|
||||
except T as foobar:
|
||||
echo(foobar.msg)
|
||||
|
||||
try:
|
||||
raise newException(Exception, "Hello")
|
||||
except Exception as foobar:
|
||||
echo(foobar.msg)
|
||||
|
||||
|
||||
test[Exception]()
|
||||
|
||||
Reference in New Issue
Block a user