fix(no-unnecessary-condition): skip no-overlap checks for indeterminate generic intersections#806
Conversation
How to use the Graphite Merge QueueAdd the label 0-merge to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Pull request overview
Fixes a false-positive in no-unnecessary-condition by treating indeterminate generic intersection types as “unknown overlap”, preventing incorrect “no overlap” diagnostics (issue #20487).
Changes:
- Extend indeterminate-type detection to also traverse intersection constituents (in addition to unions).
- Add a regression test case covering a generic function check that previously triggered the incorrect overlap diagnostic.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/rules/no_unnecessary_condition/no_unnecessary_condition.go | Updates indeterminate constituent detection to consider intersections, avoiding incorrect no-overlap checks. |
| internal/rules/no_unnecessary_condition/no_unnecessary_condition_test.go | Adds a valid test case reproducing the reported generic/intersection scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Merge activity
|
…te generic intersections (#806) fixes oxc-project/oxc#20487
89b0387 to
3130dd5
Compare

fixes oxc-project/oxc#20487