Skip to content

Warn on unconditional conditions#9816

Merged
rtfeldman merged 3 commits into
mainfrom
warn-unconditional-condition
Jun 26, 2026
Merged

Warn on unconditional conditions#9816
rtfeldman merged 3 commits into
mainfrom
warn-unconditional-condition

Conversation

@rtfeldman

Copy link
Copy Markdown
Contributor

This adds a warning when an if condition, match scrutinee, or match guard is known at compile time, making the conditional choose deterministically. The check is emitted during type checking from the existing hoistability information, so it stays tied to the condition expression itself and does not change compile-time branch coverage reporting.

@rtfeldman
rtfeldman force-pushed the warn-unconditional-condition branch from ff9d685 to ddb2f0a Compare June 25, 2026 22:27
@rtfeldman
rtfeldman marked this pull request as ready for review June 26, 2026 12:16
@rtfeldman
rtfeldman merged commit 426950d into main Jun 26, 2026
39 checks passed
@rtfeldman
rtfeldman deleted the warn-unconditional-condition branch June 26, 2026 17:42
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.

1 participant