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

Remove IRB::NotImplementedError #878

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Feb 17, 2024

NotImplementedError is defined globally, and can be used as raise NotImplementedError
But inside IRB module, raise NotImplementedError raises ArgumentError.

irb(main):001* module IRB
irb(main):002*   raise NotImplementedError
irb(main):003> end
gems/irb-1.11.2/lib/irb/lc/ja/error.rb:16:in `initialize': wrong number of arguments (given 0, expected 1) (ArgumentError)

Remove IRB::NotImplementedError and IRB::OutputMethod::NotImplementedError because we don't need it.

@@ -13,8 +13,8 @@ def initialize(val)
end
end
class NotImplementedError < StandardError
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't know IRB has a NotImplementedError 🤯

Should we remove this version and make the JA version simply inherit Ruby's NotImplementedError?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to leave it to reduce difference between locale and possibility of locale dependent bug.

@st0012
Copy link
Member

st0012 commented Feb 22, 2024

Actually, I think we don't need a locale-friendly version of NotImplementedError because it's an exception that target IRB developers instead of end users. So I prefer dropping IRB::NotImplementedError completely.

@tompng tompng changed the title IRB::NotImplementedError should accept no args Remove IRB::NotImplementedError Feb 22, 2024
@tompng
Copy link
Member Author

tompng commented Feb 22, 2024

Makes sense.
I Removed class NotImplementedError defined in IRB.

Copy link
Member

@st0012 st0012 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice cleanup 👍

@st0012 st0012 merged commit 6751778 into ruby:master Feb 22, 2024
29 checks passed
matzbot pushed a commit to ruby/ruby that referenced this pull request Feb 22, 2024
@tompng tompng deleted the not_implemented_error_args branch February 22, 2024 17:10
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.

2 participants