Skip to content
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

Fix unexpected non-local exits on Rubocop::AST::Node#parent_module_name #176

Conversation

sanfrecce-osaka
Copy link
Contributor

With this PR, when Rubocop::AST::Node#parent_module_name_part is executed, it will no longer do non-local exits when a block is evaluated, and evaluating singleton_class or block in Rubocop::AST::Node#parent_module_name will behave as expected.
With this change, this PR aims to resolve the following issue.

rubocop/rubocop#5022

With this PR, when Rubocop::AST::Node#parent_module_name_part is executed, it will no longer do non-local exits when a block is evaluated, and evaluating singleton_class or block in Rubocop::AST::Node#parent_module_name will behave as expected.
With this change, this PR aims to resolve the following issue.

rubocop/rubocop#5022
@marcandre
Copy link
Contributor

Thanks for the PR.

I can only look at this more fully tomorrow, but this PR is not acceptable as is. The original intent was that parent_module_name_part could either return or yield a value (potentially nil). This PR now conflates both and result is over complicated for what it achieves.

Either parent_module_name_part should simply return a value, or else it needs to be modified in some way to achieve what we need.

@marcandre
Copy link
Contributor

Closed in favor of #177

@marcandre marcandre reopened this May 26, 2021
@marcandre marcandre closed this Aug 10, 2021
@marcandre
Copy link
Contributor

See #197

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants