Add checks for except: body blocks (#9191)
This commit is contained in:
parent
dd65986795
commit
70018aa683
4 changed files with 42 additions and 2 deletions
10
tests/errmsgs/tgeneral_excepts.nim
Normal file
10
tests/errmsgs/tgeneral_excepts.nim
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
discard """
|
||||
errormsg: "Only one general except clause is allowed after more specific exceptions"
|
||||
"""
|
||||
|
||||
try:
|
||||
discard
|
||||
except:
|
||||
discard
|
||||
except:
|
||||
discard
|
||||
12
tests/errmsgs/tmultiple_finally.nim
Normal file
12
tests/errmsgs/tmultiple_finally.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
discard """
|
||||
errormsg: "Only one finally is allowed after all other branches"
|
||||
"""
|
||||
|
||||
try:
|
||||
discard
|
||||
finally:
|
||||
discard
|
||||
finally:
|
||||
discard
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue