In that example the tuple is a (stored) property of a class, not a global 
variable. And why does it crash for a global variable, but not for a local 
variable in a function?

(Sorry if I am overlooking something obvious.)


> On 8. Aug 2017, at 17:50, Guillaume Lessard <> 
> wrote:
>> On Aug 8, 2017, at 01:11, Martin R via swift-users <> 
>> wrote:
>> SE-0176 Enforce Exclusive Access to Memory 
>> (
>>  states that "Accesses to different stored properties of a struct or 
>> different elements of a tuple are allowed to overlap."
>> [snip]
>> Is there anything special with simultaneous access to members of a global 
>> tuple, or is this a bug?
> Not a bug. The very next sentence after the one you quoted: “However, note 
> that modifying part of a value type still requires exclusive access to the 
> entire value”. The first example in that section 
> (
>  is similar to your example; it trips the dynamic enforcement mechanism for 
> the same reason. The second example shows a possible workaround.
> Sincerely,
> Guillaume Lessard

swift-users mailing list

Reply via email to