Files
swift-atomics/Sources
Karoy Lorentey cc86c556be Fix support for non-final classes in AtomicReference
Swift 5.6/7 generates new compiler warnings when non-final classes
conform to `AtomicReference`. The warnings are pointing out a real
design issue: Self is covariant in protocols, but we intend atomic
operations to always deal with the base class rather than individual
subclasses.

Add a new associated type requirement to AtomicValue to represent the
actual type that originally conformed to the protocol, and add
explicit same-type requirements to clients to ensure they aren’t
asked to return a subclass.

Unfortunately, this change is source breaking:

```
class Base: AtomicReference {}
class Derived: Base {}

let ref = ManagedAtomic<Derived?>(nil)
  // before: OK
  // after: 'ManagedAtomic' requires the types 'Derived' and 'Base' be equivalent
```
2023-03-17 16:24:51 -07:00
..
2021-08-27 17:13:03 -07:00