mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 11:47:56 +00:00
* fixes #13583; enfore void for nkWhileStmt * one more case
This commit is contained in:
@@ -65,3 +65,37 @@ proc main2() =
|
||||
|
||||
main1()
|
||||
main2()
|
||||
|
||||
block: # bug #13583
|
||||
block:
|
||||
proc hello(): int {.discardable.} = 12
|
||||
|
||||
iterator test(): int {.closure.} =
|
||||
while true:
|
||||
hello()
|
||||
|
||||
let t = test
|
||||
|
||||
block:
|
||||
proc hello(): int {.discardable.} = 12
|
||||
|
||||
iterator test(): int {.closure.} =
|
||||
while true:
|
||||
block:
|
||||
yield 12
|
||||
hello()
|
||||
|
||||
let t = test
|
||||
doAssert t() == 12
|
||||
|
||||
block:
|
||||
proc hello(): int {.discardable.} = 12
|
||||
|
||||
iterator test(): int {.closure.} =
|
||||
while true:
|
||||
yield 12
|
||||
hello()
|
||||
|
||||
let t = test
|
||||
doAssert t() == 12
|
||||
|
||||
|
||||
Reference in New Issue
Block a user