Skip to content

[5.9] Exclude GenericParam Constraints #66894

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

angela-laar
Copy link
Contributor

@angela-laar angela-laar commented Jun 23, 2023

  • Explanation: Only preserve primary associated types during type erasure if the generic context does not contain outer generic pramaters.
    • Given func foo { ... any P <Int> ... } getNonDependentUpperBounds()
      should produce any P<Int>
    • However, given func foo<T> { ... any P<T> ... } getNonDependentUpperBounds()
      should produce any P
  • Scope: Narrow; effects existential parameterized protocol type erasure
  • Risk: Low, this adds support for parameterized protocol type to generic signature
  • Reviewers: @slavapestov @xedin
  • Issue: rdar://110262754
  • Original pull request: [GenericSignature] Exclude GenericParam Constraints #66864

Only preserve primary associated types during type erasure if the
generic context does not contain outer generic prameters.

i.e.

  Given `func foo {  ... any P <Int> ... }` getNonDependentUpperBounds()
  should produce any P<Int>

  However, given `func foo<T> { ... any P<T> ... }` getNonDependentUpperBounds()
  should produce any P

Fixes rdar://110262754
@angela-laar angela-laar requested a review from a team as a code owner June 23, 2023 18:32
@angela-laar
Copy link
Contributor Author

@swift-ci please test

@hborla hborla merged commit 5ff0f41 into swiftlang:release/5.9 Jun 27, 2023
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