* Fixed yield in nkObjConstr. Fixes #9694 * Separate expr lowering from state splitting, introduce a clear lowering internal error
This commit is contained in:
parent
5dfcc4e91c
commit
5a2290f788
2 changed files with 30 additions and 9 deletions
|
|
@ -440,4 +440,19 @@ block:
|
|||
|
||||
test(it, 1, 2, 5)
|
||||
|
||||
block: #9694 - yield in ObjConstr
|
||||
type Foo = object
|
||||
a, b: int
|
||||
|
||||
template yieldAndNum: int =
|
||||
yield 1
|
||||
2
|
||||
|
||||
iterator it(): int {.closure.} =
|
||||
let a = Foo(a: 5, b: yieldAndNum())
|
||||
checkpoint(a.b)
|
||||
|
||||
test(it, 1, 2)
|
||||
|
||||
echo "ok"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue