t8550.nim 273 B

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