Skip to content

[CS] A couple of minor diagnostic improvements #75239

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
Jul 15, 2024

Conversation

hamishknight
Copy link
Contributor

  • Avoid diagnosing overrides for invalid decls
  • Fix paren fix-it logic for non-optional weak
  • Better diagnose conformance failures for EnumElementPatterns

Invalid decls won't match any overrides in the
base class, so avoid diagnosing that they don't
override anything.
We were previously checking the optional type,
which would never say that parens were needed.
Unwrap the type before checking, ensuring we
correctly handle e.g protocol compositions.
Previously we could end up with a
ContextualMismatch fix and a MissingConformance fix
for different elements of the `matchTypes` disjunction,
leading to an ambiguity. Instead, avoid recording
the ContextualMismatch if we're matching an
existential, and tweak the MissingConformance
failure to have a custom diagnostic for
EnumElementPattern matching.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight merged commit 9d2af57 into swiftlang:main Jul 15, 2024
5 checks passed
@hamishknight hamishknight deleted the patte-diag branch July 15, 2024 18:16
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