Hello @dearblue, 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!
Summary of Changes
Gemini-code-assist has reviewed this pull request. This PR is a revert of a previous commit ( 3879b95 ) which introduced a regression. According to the description, this regression caused code related to method visibility, specifically when private is used within a lambda inside a class definition, to stop working as expected, as reported in issue #6494. To fix this, the PR restores the original logic in src/class.c and adds a new test case to test/t/module.rb to ensure this specific scenario is covered and doesn't regress again in the future.
Highlights
- Revert Regression Fix: This pull request reverts commit 3879b95 , which is identified as the cause of a regression.
- Fixes Issue #6494: The regression addressed by this revert is the one reported in issue #6494, concerning incorrect behavior of method visibility (
private) in specific code patterns involving lambdas within class definitions. - Add Regression Test: A new test case is added to the test suite to specifically cover the scenario described in #6494, helping to prevent this regression from being reintroduced.
Changelog
- src/class.c
- Reverts the change on line 767 within the
find_visibility_scopefunction, restoring the logic to correctly determine and assign the environment pointer (*ep).
- Reverts the change on line 767 within the
- test/t/module.rb
- Adds a new test case starting around line 843 to verify that attempting to call a method defined after
private(whenprivateis called within a lambda inside a class definition) correctly raises aNoMethodError.
- Adds a new test case starting around line 843 to verify that attempting to call a method defined after
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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.
A bug crept inside,
A revert sets things right,
Tests stand guard now.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. โฉ