I need to create a structure that looks like an int (but has an extra field that I need...), so I created a new structure named TestStruct added one method (test()) that I n
When you use Val, the property is returning a copy , it's that copy you modify, then you access the property again which gets another copy.
If you change the struct to a class this problem should go away because if the difference in how classes and structs are treated.