Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
String or sequences inside a loop are not cleared in each iteration #11510
A string needs to be explicitly initialized inside a loop so its contents are cleared in each iteration. There is a difference in the following program's output between nim "current" and newruntime. The bug is about newruntime.
proc main = for i in 0 ..< 4: var buffer: seq[int] # = @ # uncomment to make it work # var buffer: string # also this is broken buffer.add i echo buffer main()
When compiling with