proc p(i: var int) =
echo i
var i: int = 7
p(i)
p(int(i))
p(cast[int](i))
t3.nim(8, 2) Error: for a 'var' type a variable needs to be passed
So the last line is not valid. So we regard a cast as something like a function returning something, and not like simple ignoring type check. But the type conversion one line before is valid. Hmm. Of course, here the cast is a NOP indeed.
This should work:
p(cast[var int](addr i))