Skip to content

[5.6][SE-0309] Disable SE-0309 in Swift 5.6. #41131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 3, 2022

Conversation

hborla
Copy link
Member

@hborla hborla commented Feb 1, 2022

  • Explanation: SE-0309 enables using protocols with Self or associated type requirements as existential types. This feature is not fully implemented; one of the missing pieces from the proposal in Swift 5.6 is covariant erasure for dependent-member types, which allows calling the APIs that use Self or associated type in covariant position on the existential type. Without this functionality, the API surface on SE-0309 existentials is fairly limited, and leads to confusing error messages when attempting to call APIs that should be available via covariant erasure. This change adds a frontend flag -enable-experimental-universal-existentials for SE-0309, and disables the feature by default. This change also disables building the experimental _Distributed library by default, because it adopts SE-0309 (in code that no longer exists on the main branch).
  • Scope: This is a new feature in Swift 5.6, so there is no impact on existing code.
  • Risk: Because this is a new feature, there is no risk for taking this change.
  • Testing: Added the -enable-experimental-universal-existentials flag to several existing tests that make use of SE-0309.

@hborla hborla requested a review from a team as a code owner February 1, 2022 19:19
@hborla
Copy link
Member Author

hborla commented Feb 1, 2022

@swift-ci please clean test

@AnthonyLatsis
Copy link
Collaborator

Thanks! I imagined this was going to be more of a pain in one place but then you just gated it behind a flag 😅

@hborla
Copy link
Member Author

hborla commented Feb 1, 2022

@AnthonyLatsis it was pretty convenient that I happened to already put the code that identifies SE-0309 existentials back for SE-0335 😆

@hborla
Copy link
Member Author

hborla commented Feb 2, 2022

@swift-ci please test

@hborla hborla merged commit 31aafc7 into swiftlang:release/5.6 Feb 3, 2022
@hborla hborla deleted the 5.6-disable-se-0309 branch February 3, 2022 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants