Pitch: Back-deployment for fixed-layout value types - #3571

Hi all,

@tshortli and I found a way to do back-deployment for a limited class of types, specifically, @frozen struct and enum types with a fixed layout. The proposal here is to extend the existing @backDeployed(before:) attribute to cover these types. Then, we can adopt it for a number of core types in the standard library:

  • Span family:

    • Span

    • RawSpan

    • MutableSpan

    • MutableRawSpan

    • OutputSpan

    • OutputRawSpan

    • ByteOrder

  • Ref family

    • Ref (only back-deployable to Swift 6.2-era runtimes)

    • MutableRef

  • Cell family (still under review)

    • Cell

    • ConstCell

    • Volatile

  • UInt128 and Int128

  • Unique (non-copyable) types

    • UniqueArray

    • UniqueBox

  • Synchronization

    • Mutex

    • Disconnected

  • Concurrency

    • Continuation

    • TaskID

There is one limitation on retroactive protocol conformances to resilient protocols, which is outlined in the proposal itself.

Doug

5 Likes