This is why inout data is not allowed to be stored as a global (which essentially you have done). Basically, inout data should not be allowed to escape the function except via the parameters or return, where it is properly handled.
Comment #2 by dfj1esp02 — 2021-12-13T13:36:57Z
As I understand, it's due to decision that nested functions use inout qialifier of the outer function. Then an easy way to fix this is to disallow conversion of such nested function to inout-typed delegate.
Comment #3 by robert.schadek — 2024-12-13T18:54:00Z