-
Notifications
You must be signed in to change notification settings - Fork 32
fix(method-lookup): consider embedded named types when resolving #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @go-wyvern, 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 crucial fix to the method lookup mechanism within the Highlights
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
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #549 +/- ##
==========================================
- Coverage 96.01% 95.99% -0.02%
==========================================
Files 23 23
Lines 7358 6474 -884
==========================================
- Hits 7065 6215 -850
+ Misses 227 193 -34
Partials 66 66 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
The pull request aims to fix method lookup by considering embedded named types. The change introduces a loop to check for methods on embedded types. However, the implementation has two significant issues: it doesn't handle circular embeddings, which can lead to infinite recursion, and it fails to consider embedded pointers to named types. I've provided feedback on both points, including a critical issue regarding the potential stack overflow and a high-severity issue for the incomplete method resolution, with a code suggestion to address the latter.
Code Review SummaryThe fix correctly addresses method lookup for embedded named types in interfaces. The implementation is clean and follows existing patterns. Key findings:
The change is production-ready. Consider clarifying whether anonymous embedded interfaces should also be supported. |
Code Review SummaryThe fix correctly addresses method resolution for embedded named interfaces. The implementation follows existing patterns and the test validates the happy path. Three noteworthy issues identified:
Overall solid fix that would benefit from defensive cycle detection before merge. |
fix(goplus/builder#2499)
Problem Description
When handling the method overload feature, the behavior of
types.Interface.Method(i)does not meet expectations.Root Cause:
types.Interfaceuses theunderlyingapproach to retrieve the method set when handlingembeddedstypes.Namedtype we passed throughNewInterfaceTypetypespackage implementation itself is correct, but it doesn't accommodate our method overload feature requirementsSolution
Iterate through
embeddedsand usetypes.Namedto retrieve methods, ensuring proper handling of method overload scenarios.