[Foundation] Fix exclusivity warnings in DateComponents
[Foundation] Fix exclusivity warnings in DateComponents

DateComponents has a number of exclusivity warnings that all result from the same idiom
for applying mutation in computed properties:

    public var era: Int? {
        get { return _handle.map { _getter($0.era) } }
        set { _applyMutation { $0.era = _setter(newValue) } }
    }

Here _applyMutation() is a mutating method, so it requires exclusive access to 'self'
for the duration of the call. However, calling the _setter() method in the block
requires access to read 'self', which conflicts with the already in-progress modifying
access begun by _applyMutation().

A fix is to change _setter() to be a static function, so it doesn't require access to
'self'.

apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation,apple/swift-corelibs-foundation