@1-877-547-7272 Thanks, but I doubt it. If what you said is true, it should be unlikely to run into exclusive memory access error in single thread code. But I'm quite sure that's not the case.
SE-176 described non-instantaneous access as below:
For example, when you call a
mutating
method on a stored property, it's really one long access to the property:self
just becomes another way of referring to the property's storage. This access isn't instantaneous because all of the code in the method executes during it, ...
Then it continued to describe overlap:
... so if that code manages to access the same property again, the accesses will overlap.so if that code manages to access the same property again, the accesses will overlap.
I think my example code is similar. The only difference is that in the above description it's different code modifying the same property, but in my example it's different code modifying self
, which is the entire value. So I think my example has the same issue and shouldn't compile.