Results 7 comments of Giuliano Mega

!nim c --gc:refc ```nim type AnObject* = object of RootObj value*: int proc mutate(a: sink AnObject) = a.value = 1 var obj = AnObject(value: 42) mutate(obj) doAssert obj.value == 42...

Btw, I've realized that force-enabling `injectDestructorCalls` (in [genProcAux](https://github.com/nim-lang/Nim/blob/version-1-6/compiler/cgen.nim#L1045)) fixes the issue, as does creating a bogus destructor for `AnObject`. My currently working hypothesis is that the sink copy logic (which...

!nim c --gc:refc ```nim type AnObject = object of RootObj value*: int proc `=destroy`(x: var AnObject) = discard proc mutate(a: sink AnObject) = a.value = 1 var obj = AnObject(value:...

> @gmega oh odd, adding a destructor for the test object fixes it? Hmmm, maybe it'll be an easy fix of triggering whatever logic gets triggered when there's a destructor....

Indeed. This is a great project as you can get support for application-side schemas in Firestore while getting everything Pydantic has to offer (e.g. unlike other Firebase "ORMs" which have...