refactor: migrate avoid_unnecessary_type_assertions#282
refactor: migrate avoid_unnecessary_type_assertions#282andrew-bekhiet-solid wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the avoid_unnecessary_type_assertions lint rule and its associated quick fix to use the new AnalysisRule and ResolvedCorrectionProducer APIs. The logic is modularized into separate visitors for is expressions and whereType method invocations, and comprehensive unit tests are introduced. However, there are critical issues to address: first, the quick fix pattern matching on node will fail because node resolves to a leaf AST node, so thisOrAncestorOfType should be used instead. Second, the whereType visitor can crash with a StateError when encountering non-generic classes that implement Iterable, which requires safely extracting the type argument from the Iterable supertype. Finally, a test case should be added to verify this non-generic iterable scenario.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
fix: remove leading space when removing is operator
refactor: simplify removal code
cd4001d to
27f6bcc
Compare
Fixes #271