t8550.nim 255 B

12345678910111213
  1. discard """
  2. output: "@[\"42\"]"
  3. """
  4. proc chk_fail(): seq[string] =
  5. iterator x(): int {.closure.} = yield 42
  6. proc f(cl: iterator(): int {.closure.}): seq[string] =
  7. result = @[]
  8. for i in cl(): result.add($i)
  9. result = f(x)
  10. echo(chk_fail())