fixes #2023
This commit is contained in:
parent
3b45ac44e1
commit
ecc3c3bd03
2 changed files with 19 additions and 3 deletions
16
tests/iter/tobj_iter.nim
Normal file
16
tests/iter/tobj_iter.nim
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# bug #2023
|
||||
|
||||
{.deadCodeElim:on.}
|
||||
|
||||
type
|
||||
Obj = object
|
||||
iter: iterator (): int8 {.closure.}
|
||||
|
||||
iterator test(): int8 {.closure.} =
|
||||
yield 7
|
||||
|
||||
proc init():Obj=
|
||||
result.iter = test
|
||||
|
||||
var o = init()
|
||||
echo(o.iter())
|
||||
Loading…
Add table
Add a link
Reference in a new issue