Skip to content

Bugfix: Pattern match incompleteness for enum was hiding more serious issues #15618

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

T-Gro
Copy link
Member

@T-Gro T-Gro commented Jul 18, 2023

Tests are issue reports:
fixes #15597
fixes #14621

What was happening before:

  • The first ever incompleteness warning was reported, and later warnings did not go trough counterexample generating phase at all
  • This makes sense in reducing the number of warnings, however pattern match incompleteness has (as of now) two different warnings - a generic one and a special one for enums
  • Therefore, it is easily possible to have one or the other disabled. With this in action, it could mean that a warning is shadowed by one that is ignored => not good

The approach has been redone to keep:

  • The same IL by generating the failure action just once (this is important)
  • Reporting each type of warning just once (this is subjective/opinionated: Could be even further imploded to report everything, but would lead to even more warnings and therefore more regressions in error baselines)
  • Keep regressions in test suites only to the desired ones (matching the reported bugs)

@T-Gro T-Gro changed the title [WIP] Bugfix: Pattern match incompleteness for enum was hiding more serious issues. See what breaks. Bugfix: Pattern match incompleteness for enum was hiding more serious issues Jul 19, 2023
@T-Gro T-Gro marked this pull request as ready for review July 19, 2023 15:05
@T-Gro T-Gro requested a review from a team as a code owner July 19, 2023 15:05
@T-Gro T-Gro requested review from auduchinok and edgarfgp July 19, 2023 15:26
@T-Gro T-Gro merged commit 786a33b into dotnet:main Jul 19, 2023
@T-Gro T-Gro deleted the 15597-incomplete-match-coverage-error-when-using-nowarn-104 branch July 19, 2023 18:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Incomplete match coverage error when using "nowarn 104" No FS0025 'match incomplete' error when covering all inner enum fields
5 participants