Skip to content

[6.0][IRGen] Strip marker protocols in a few more places #74138

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 2 commits into from
Jun 5, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 5, 2024

Cherry-pick of #74130


  • Explanation:

    Fixes a recent regression that leads on an infinite recursion in metadata accessors for generic types and improves handling of protocol compositions that have only marker protocols.

    • Strip marker protocols when forming generic metadata requests

      Without this might might end up with a single element protocol compositions
      which are invalid.

    • Move marker protocol stripping from mangleTypeSymbol to mangleTypeForFlatUniqueTypeRef

      The original check introduced by [AST] Special handling for existentials with superclass and marker pr… #71855
      is too broad. For concrete metadata we call the runtime demangler so
      we need to strip off marker protocols when mangling that string and
      mangleTypeForReflection already does that.

  • Scope: Generic metadata accessors

  • Main Branch PR: [IRGen] Strip marker protocols in a few more places #74130

  • Resolves: rdar://128667580

  • Risk: Low

  • Reviewed By: @slavapestov

  • Testing: Added new tests to the test suite.

xedin added 2 commits June 5, 2024 00:30
Without this might might end up with a single element protocol compositions
which are invalid.

(cherry picked from commit 552749e)
…ngleTypeForFlatUniqueTypeRef`

The original check introduced by swiftlang#71855
is too broad. For concrete metadata we call the runtime demangler so
we need to strip off marker protocols when mangling that string and
`mangleTypeForReflection` already does that.

(cherry picked from commit 5d243bd)
@xedin xedin added 🍒 release cherry pick Flag: Release branch cherry picks swift 6.0 labels Jun 5, 2024
@xedin xedin requested review from nkcsgexi and hborla June 5, 2024 07:39
@xedin xedin requested a review from a team as a code owner June 5, 2024 07:39
@xedin
Copy link
Contributor Author

xedin commented Jun 5, 2024

@swift-ci please test

@hborla hborla merged commit 8c09df1 into swiftlang:release/6.0 Jun 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants