Repository navigation
feat(diagnostic): add non-callable call checker - #940
Conversation
Summary of ChangesHello @lewis6991, 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 introduces a new diagnostic checker that identifies and flags attempts to invoke expressions that are not callable. It enhances the type analysis capabilities by providing precise warnings when non-function types like numbers, strings, or booleans are treated as functions. The changes include the implementation of the checker, its integration into the diagnostic system, and a refinement in type inference caching to ensure accurate reporting. 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. 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 introduces a new diagnostic checker to detect calls to non-callable expressions. The overall implementation is good, but I've found a critical logic error in how union types are handled, which will cause false-positive diagnostics. There's also a section of logic that is unclear and could lead to incorrect behavior, which I've suggested refactoring for clarity and correctness. Additionally, some of the new tests are written to expect the buggy behavior and will need to be updated along with the implementation fix. The other changes, such as wiring up the new checker and improving the call inference cache, look solid.
b933710 to
8be56e5
Compare
8be56e5 to
9da9d4d
Compare
| insert_if_non_callable(t); | ||
| } | ||
| } | ||
| LuaType::TypeGuard(inner) => { |
There was a problem hiding this comment.
typeguad is actually treated as a boolean
| &InferGuard::new(), | ||
| None, | ||
| ); | ||
| if let Err(reason) = &call_result { |
There was a problem hiding this comment.
How? I need access to reason.
There was a problem hiding this comment.
Okay, it just feels like the logic here is redundant — why are there two if statements?
9da9d4d to
7eafe3d
Compare
No description provided.