❔ Structure keeps on nulling a field
Hello, there. I'm currently struggling with a problem, which includes a struct of mine that keeps on nulling an uint[] field named "_indices" (which is initialised with a field initialiser) after exiting the constructor. I've tried to initialise it in the constructor instead, but to no avail... Turning the struture into a class seems to fix the problem, but i would like to keep it as a struct
5 Replies
The source code:
Why do you want to keep it a struct? arrays are reference types, so this struct of yours will go on the heap regardless
because of pointers
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.