Nim 2 decides copy or move per call site. Not per proc.
proc take(s: sink seq[int]) =
echo s.len
proc main() =
var a = @[1, 2, 3]
take(a) # copied, `a` is read again below
take(a) # last read of `a`, moved
main()
Same argument, same proc. The first call copies, because a is still needed. The second moves. Nothing at the call site says which. nim c --expandArc:main prints the rewritten body and shows both.
Locals only. The destructors doc says the analysis is limited to local variables, so the test lives in a proc, and --expandArc wants that proc's name anyway.
