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

Suppress 'Maybe IRB bug!' message in extract_ruby_args #959

Closed

Conversation

tompng
Copy link
Member

@tompng tompng commented May 22, 2024

Improve error message of #958

irb(main):001> measure = 1
undefined method `extract_ruby_args=' for module IRB::Command (NoMethodError)
IRB::Command.extract_ruby_args = 1
            ^^^^^^^^^^^^^^^^^^^^
Maybe IRB bug!

This is not a bug. "= 1" is an invalid argument for measure command.

irb(main):002> measure a + b
undefined local variable or method `a' for main (NameError)
IRB::Command.extract_ruby_args a + b
                               ^
Maybe IRB bug!

This is also not a bug.

This pull request improves the error message with less effort.
Note that IRB::Command::RubyArgsExtractor is a backward-compatibility layer of command arguments and we are going to reduce using it.

@tompng
Copy link
Member Author

tompng commented May 26, 2024

#961 will solve most of the problem.

@tompng tompng closed this May 26, 2024
@tompng tompng deleted the improve_extract_ruby_args_exception branch May 26, 2024 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant