Repository navigation
fix(code-analysis): strip implicit self from doc call operators - #980
Conversation
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses incorrect diagnostic reporting for Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses incorrect diagnostics for ---@operator call by normalizing function types and introducing to_call_operator_func_type to handle call operators, with new tests confirming fixes for missing-parameter and param-type-mismatch errors. No security vulnerabilities were found, and the implementation appears correct with no further suggestions for improvement.
Strip only the synthetic receiver from doc-defined `---@operator call` signatures when exposing them as callable function types. Preserve user-authored overload parameters named or typed `self`, and keep generic instantiation working for explicit-self call overloads like `fun<T>(self: self, value: T): T`. This fixes false `missing-parameter` and `param-type-mismatch` diagnostics for doc call operators while preserving `self`-returning overloads and constructor-style call inference. Add regressions for chained call-operator methods, parameter type checks, explicit `self` overloads, and generic explicit-self call overloads.
cb90f41 to
1185967
Compare
Normalize doc-defined
---@operator callfunctions by dropping theimplicit
selfparameter when exposing them as callable function types.This fixes false
missing-parameterandparam-type-mismatchdiagnostics for zero-arg call operators and chained method calls on
their return values.