Procs
proc deepCopy(s: seq[NimNode]): seq[NimNode] {....raises: [], tags: [], forbids: [].}
-
To get rid of compile-error caused by Nim's backward non-compatibility change:
Error: illegal capture 'selfNoCast' because 'addPyIntObjectMagic' has the calling convention: <cdecl>
Bacause for all procs generated by implMethod, whose 1st param is selfNoCast ( take it for example, so for other params),
if not deepCopy, their selfNoCast symbol was shared (there's only one instance), so its loc would be updated each time implMethod is called.
Finally selfNoCast would be considered to be placed at the place where the last implMethod was called. So for all implMethod-ed procs except the last, their selfNoCast were mistakely considered as captured
Old Nim compiler didn't behave so.
Source Edit