You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Swift 3.2 and Swift 4, the new exclusive memory access model is a bit too strict when looking at mutating methods of structs. Mutating methods that mutate two different stored properties of self in the same expression are considered to be in error, even though this is a perfectly normal thing to want to do and should be safe.
This complains about the utf8.decode(&iter), as this modifies both the utf8 and iter properties. These are stored properties without property observers, so the accesses to the properties are wholly independent.
(We usually try not to make special cases for stored vs. computed properties, but there's already been talk of some other exceptions for exclusive access checking.)
Environment
Apple Swift version 4.0 (swiftlang-900.0.43 clang-900.0.22.8)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: 19130628523dc9a92b79788f529809d8
Issue Description:
In Swift 3.2 and Swift 4, the new exclusive memory access model is a bit too strict when looking at mutating methods of structs. Mutating methods that mutate two different stored properties of self in the same expression are considered to be in error, even though this is a perfectly normal thing to want to do and should be safe.
For example:
This complains about the
utf8.decode(&iter)
, as this modifies both theutf8
anditer
properties. These are stored properties without property observers, so the accesses to the properties are wholly independent.This affects the PMJSON library.
The text was updated successfully, but these errors were encountered: