Skip to content

[5.7][RequirementMachine] Diagnose type parameters that are made concrete by a same-type requirement. #42331

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
Apr 18, 2022

Conversation

hborla
Copy link
Member

@hborla hborla commented Apr 13, 2022

Cherry-pick of #42257

  • Explanation: This change adds requirement machine diagnostics for when type parameters in a generic signature are made concrete or equivalent to another type parameter through a same-type constraint by looking for non-canonical generic parameters in a minimal signature.
  • Scope: The change is scoped to requirement machine requests.
  • Risk: Low. The change adds diagnostics that already existed in the GSB, and downgrades errors to warnings in the cases where the requirement machine diagnostics are more strict.
  • Testing: Updated several tests throughout the test suite.
  • Reviewer: @slavapestov

hborla added 3 commits April 12, 2022 18:28
warning.

These diagnostics are stricter in the RequirementMachine than in the GSB,
and there's code that relies on the more relaxed diagnostics in the source
compatibility suite. Downgrade these diagnostics to a warning using
warnUntilSwiftVersion(6).
@hborla hborla requested a review from a team as a code owner April 13, 2022 01:30
@hborla
Copy link
Member Author

hborla commented Apr 13, 2022

@swift-ci please test

1 similar comment
@hborla
Copy link
Member Author

hborla commented Apr 15, 2022

@swift-ci please test

@hborla hborla added the r5.7 label Apr 15, 2022
@hborla hborla merged commit 4eb7dad into swiftlang:release/5.7 Apr 18, 2022
@hborla hborla deleted the 5.7-concrete-generic-params branch April 18, 2022 16:05
@AnthonyLatsis AnthonyLatsis added 🍒 release cherry pick Flag: Release branch cherry picks swift 5.7 labels Jan 9, 2023
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 5.7
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants