var s= @[1,2,3]
var pos=0
test(s,pos)
You are returning a 'expr' when you should be returning a 'stmt'.
I have heard Araq mention that this difference will be removed in later versions of Nimrod as it is quite annoying. Key thing to remember for now is: if it's longer than one line, then it is a stmt, otherwise it's an expr.