fix(generic): resolve higher-order callable returns by args#990
fix(generic): resolve higher-order callable returns by args#990lewis6991 wants to merge 1 commit intoEmmyLuaLs:mainfrom
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 significantly refactors the type inference logic for higher-order callable types, particularly when they involve unions or intersections. The system now employs a more robust overload resolution strategy, where argument types are used to select the most appropriate callable signature from a set of candidates, thereby yielding a more precise return type. This change improves the accuracy of type analysis for complex function definitions and calls. 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. Footnotes
|
|
Warning Gemini is experiencing higher than usual traffic and was unable to create the review. Please try again in a few hours by commenting |
6d8cf17 to
4705986
Compare
Flatten callable unions and intersections into callable candidates, instantiate them from the remaining argument types, and select the matching return via overload resolution instead of unioning member returns directly. Add focused pcall regressions for callable union and intersection values. Callable union handling still mirrors overload-style resolution and is not semantically complete yet; leave that for follow-up work.
4705986 to
be9caeb
Compare
| { | ||
| return Ok(Some(fallback_return)); | ||
| } | ||
| let _ = tpl_pattern_match_args(&mut callable_context, &callable_param_types, call_arg_types); |
Flatten callable unions and intersections into callable candidates,
instantiate them from the remaining argument types, and select the
matching return via overload resolution instead of unioning member
returns directly.
Add focused pcall regressions for callable union and intersection
values. Callable union handling still mirrors overload-style resolution
and is not semantically complete yet; leave that for follow-up work.