summary refs log tree commit diff stats
path: root/tests/iter/tobj_iter.nim
blob: a894755d71c830165f878e7b4cfcec383ff81c86 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
discard """
  output: "7"
"""

# bug #2023

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())