fixes #292
This commit is contained in:
parent
3c73654aca
commit
1bc5ff6dc9
2 changed files with 23 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
#
|
||||
#
|
||||
# The Nimrod Compiler
|
||||
# (c) Copyright 2012 Andreas Rumpf
|
||||
# (c) Copyright 2013 Andreas Rumpf
|
||||
#
|
||||
# See the file "copying.txt", included in this
|
||||
# distribution, for details about the copyright.
|
||||
|
|
@ -146,8 +146,11 @@ proc catches(tracked: PEffects, e: PType) =
|
|||
dec L
|
||||
else:
|
||||
inc i
|
||||
setLen(tracked.exc.sons, L)
|
||||
|
||||
if not isNil(tracked.exc.sons):
|
||||
setLen(tracked.exc.sons, L)
|
||||
else:
|
||||
assert L == 0
|
||||
|
||||
proc catchesAll(tracked: PEffects) =
|
||||
if not isNil(tracked.exc.sons):
|
||||
setLen(tracked.exc.sons, tracked.bottom)
|
||||
|
|
|
|||
17
tests/compile/teffects1.nim
Normal file
17
tests/compile/teffects1.nim
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
|
||||
type
|
||||
PMenu = ref object
|
||||
PMenuItem = ref object
|
||||
|
||||
proc createMenuItem*(menu: PMenu, label: string,
|
||||
action: proc (i: PMenuItem, p: pointer) {.cdecl.}) = nil
|
||||
|
||||
var s: PMenu
|
||||
createMenuItem(s, "Go to definition...",
|
||||
proc (i: PMenuItem, p: pointer) {.cdecl.} =
|
||||
try:
|
||||
echo(i.repr)
|
||||
except EInvalidValue:
|
||||
echo("blah")
|
||||
)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue