Skip to content

[5.7-04182022][IRGen] Restore the old code path for emitting existential type metadata for plain protocol and protocol composition types. #58502

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

Conversation

hborla
Copy link
Member

@hborla hborla commented Apr 28, 2022

Cherry-pick of #58485

  • Explanation: Protocol and protocol composition types should always be wrapped in ExistentialType, but there isn't sufficient validation of this throughout the compiler yet. Change the fatal error when the metadata request sees these plain types to an assert, and restore the old type metadata emission path for protocol and protocol composition types to avoid crashing in those cases.
  • Scope: This change only affects cases that would previously hit the llvm_unreachable for protocol constraint types in EmitTypeMetadataRef.
  • Risk: Low.
  • Testing: Passed CI tests.
  • Reviewer: @DougGregor

Resolves: rdar://92413116

for plain protocol and protocol composition types.

These types should always be wrapped in ExistentialType, but there isn't
sufficient validation of this throughout the compiler yet. Change
the fatal error when the metadata request sees these plain types to an
assert and restore the old type metadata emission path for protocol and
protocol composition types to avoid crashing in those cases.
@hborla hborla requested a review from a team as a code owner April 28, 2022 20:29
@hborla
Copy link
Member Author

hborla commented Apr 28, 2022

@swift-ci please test

@hborla hborla merged commit 679b59d into swiftlang:release/5.7-04182022 Apr 29, 2022
@hborla hborla deleted the 5.7-04182022-existential-type-metadata-fix branch April 29, 2022 00:09
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.

2 participants