Files
Nim/tests/iter/t22148.nim
ringabout 942c378659 fixes #22148; std/memfiles.memSlices nesting now fails with memory sa… (#22154)
* fixes #22148; std/memfiles.memSlices nesting now fails with memory safety capture violation

* adds a test case
2023-06-25 17:15:47 +02:00

16 lines
318 B
Nim

discard """
action: compile
"""
import std/memfiles
# bug #22148
proc make*(input: string) =
var inp = memfiles.open(input)
for line in memSlices(inp):
let lineF = MemFile(mem: line.data, size: line.size)
for word in memSlices(lineF, ','):
discard
make("") # Must call to trigger