Fixes 7845
This commit is contained in:
parent
03653ab61e
commit
7302a8ce7a
3 changed files with 24 additions and 9 deletions
|
|
@ -1,9 +1,12 @@
|
|||
discard """
|
||||
outputsub: "-6"
|
||||
targets: "c cpp"
|
||||
"""
|
||||
type
|
||||
ESomething = object of Exception
|
||||
ESomeOtherErr = object of Exception
|
||||
ESomethingGen[T] = object of Exception
|
||||
ESomethingGenRef[T] = ref object of Exception
|
||||
|
||||
proc genErrors(s: string) =
|
||||
if s == "error!":
|
||||
|
|
@ -27,4 +30,17 @@ proc blah(): int =
|
|||
|
||||
echo blah()
|
||||
|
||||
# Issue #7845, raise generic exception
|
||||
var x: ref ESomethingGen[int]
|
||||
new(x)
|
||||
try:
|
||||
raise x
|
||||
except ESomethingGen[int] as e:
|
||||
discard
|
||||
|
||||
try:
|
||||
raise new(ESomethingGenRef[int])
|
||||
except ESomethingGenRef[int] as e:
|
||||
discard
|
||||
except:
|
||||
discard
|
||||
Loading…
Add table
Add a link
Reference in a new issue