Uploaded image for project: 'Swift'
  1. Swift
  2. SR-260

Add availability information to @_fixed_layout attribute

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:
      None

      Description

      We wish to express that a type was formerly resilient, but became fixed layout. This requires adding an optional availability annotation to @_fixed_layout and plumbing it through to serialization.

      The new attribute has the following semantic consequences:

      • At the SIL level, types are still passed and returned indirectly if they were ever resilient – this ensures that changing the deployment version does not change the SIL type lowering of function types, since doing that would require generating multiple entry points for functions that reference conditinally-fixed-layout value types
      • IRGen however can make assumptions about fixed layout types if the deployment target is at least that of the type

      The isResilient() check in NominalTypeDecl will be extended to take a deployment target version too. SIL will not use this, but IRGen will.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                slavapestov Slava Pestov
                Reporter:
                slavapestov Slava Pestov
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: