Closed eggplants closed 1 year ago
Looks like a bug or limitation with strictFuncs
to me. This is the stdlib code in newXmlTree
the compiler complains about:
for i in 0..children.len-1: result.s[i] = children[i]
And here is a minimal reproduction of the compiler behavior:
type
Node = ref object
# Accepted by the compiler
func ok(children: seq[Node]): seq[Node] =
for i, c in children:
result[i] = c
# Not accepted - compiler complains about side effects that doesn't exist
func notok(children: seq[Node]): seq[Node] =
for i in 0..children.len-1:
result[i] = children[i]
I'm new to nim so I don't know much about this error, but shouldn't the
exec
func in nimquery be changed to proc?