Skip to content

trace method can't accept number as first argument #975

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

Closed
MasanoriOnishi opened this issue May 5, 2023 · 0 comments
Closed

trace method can't accept number as first argument #975

MasanoriOnishi opened this issue May 5, 2023 · 0 comments

Comments

@MasanoriOnishi
Copy link
Contributor

Your environment

  • ruby -v: ruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [x86_64-linux]
  • rdbg -v: rdbg 1.7.2

Describe the bug
In the following code, Signal.#trap method is overridden.
https://github.com/ruby/debug/blob/v1.7.2/lib/debug/session.rb#L2520

Although the original trap code can accept Integer, the above can't.

To Reproduce

irb(main):001:0> require 'debug'
=> true
irb(main):002:0> trap(3,1)
/usr/local/bundle/gems/debug-1.7.2/lib/debug/session.rb:2520:in `trap': undefined method `to_sym' for 3:Integer (NoMethodError)

      case sig&.to_sym
              ^^^^^^^^
Did you mean?  to_s
	from (irb):2:in `<main>'
	from /usr/local/bundle/gems/irb-1.6.4/exe/irb:9:in `<top (required)>'
	from /usr/local/bundle/bin/irb:25:in `load'
	from /usr/local/bundle/bin/irb:25:in `<main>'

Expected behavior
trace method should accept number as first argument.

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

No branches or pull requests

2 participants