enforce void for nkWhileStmt [backport: 2.0] (#21170)
enforce void for nkWhileStmt
This commit is contained in:
parent
86a6c90c9e
commit
9323cb7b2a
2 changed files with 11 additions and 1 deletions
|
|
@ -99,3 +99,14 @@ block: # bug #13583
|
|||
let t = test
|
||||
doAssert t() == 12
|
||||
|
||||
block:
|
||||
proc bar(): string {.discardable.} =
|
||||
"15"
|
||||
|
||||
proc foo(): int =
|
||||
while true:
|
||||
raise newException(ValueError, "check")
|
||||
12
|
||||
|
||||
doAssertRaises(ValueError):
|
||||
doAssert foo() == 12
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue