I tried to compile: (example drawn from the sequtils documentation)
proc run() =
var dest = @[1, 1, 1, 1, 1, 1, 1, 1]
let src = @[2, 2, 2, 2, 2, 2]
let outcome = @[1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1]
dest.insert(src, 3)
assert dest == outcome
run()
But it doesn't. The compiler complains with a type mismatch, expecting a sink T. So, either the doc doesn't tell the complete story, or something else is going on.
Is insert depracated?
You have to import a module to use it.
Interesting. I included another file that imported sequtils. So I thought that it already was available. Your are right, if I import sequtils (again), it works. Thank you.
I included another file that imported sequtils
please post complete, minimized examples otherwise it's impossible to tell if there's an actual bug or not
please post complete, minimized examples otherwise it's impossible to tell if there's an actual bug or not
I didn't claim a bug. The sequtils was hidden behind another import layer, so it's okay that the compiler didn't know about it. However, the compiler knew about it, because it reported the correct proc sig. This is a bit odd.