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 warnings #18

Merged
merged 1 commit into from
Jun 29, 2019
Merged

Suppress warnings #18

merged 1 commit into from
Jun 29, 2019

Conversation

pocke
Copy link
Member

@pocke pocke commented Jun 13, 2019

IRB displays warnings when it loads extensions.

$ RUBYOPT='-w -Ilib/' exe/irb -f -r irb/ext/history.rb
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/history.rb:44: warning: method redefined; discarding old eval_history=
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:239: warning: previous definition of eval_history= was here
irb(main):001:0> 


$ RUBYOPT='-w -Ilib/' exe/irb -f -r irb/ext/use-loader.rb
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/use-loader.rb:24: warning: method redefined; discarding old irb_load
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:142: warning: previous definition of irb_load was here
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/use-loader.rb:28: warning: method redefined; discarding old irb_require
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:142: warning: previous definition of irb_require was here
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/use-loader.rb:50: warning: method redefined; discarding old use_loader=
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:239: warning: previous definition of use_loader= was here
irb(main):001:0> 


$ RUBYOPT='-w -Ilib/' exe/irb -f -r irb/ext/save-history.rb
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/save-history.rb:40: warning: method redefined; discarding old save_history=
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:239: warning: previous definition of save_history= was here
irb(main):001:0> 

This change will suppress the warnings.

Note

I cannot load irb/ext/tracer.rb because of an error.
So I don't touch the extension.

$ RUBYOPT='-w -Ilib/' exe/irb -f -r irb/ext/tracer
/home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/tracer.rb:37: warning: method redefined; discarding old use_tracer=
/home/pocke/ghq/github.com/ruby/irb/lib/irb/extend-command.rb:239: warning: previous definition of use_tracer= was here
Traceback (most recent call last):
        12: from exe/irb:11:in `<main>'
        11: from /home/pocke/ghq/github.com/ruby/irb/lib/irb.rb:381:in `start'
        10: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/init.rb:21:in `setup'
         9: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/init.rb:281:in `load_modules'
         8: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/init.rb:281:in `each'
         7: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/init.rb:283:in `block in load_modules'
         6: from /home/pocke/.rbenv/versions/trunk/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:54:in `require'
         5: from /home/pocke/.rbenv/versions/trunk/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:54:in `require'
         4: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/tracer.rb:14:in `<top (required)>'
         3: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/tracer.rb:70:in `<module:IRB>'
         2: from /home/pocke/ghq/github.com/ruby/irb/lib/irb/ext/tracer.rb:19:in `initialize_tracer'
         1: from /home/pocke/.rbenv/versions/trunk/lib/ruby/2.7.0/tracer.rb:265:in `add_filter'
/home/pocke/.rbenv/versions/trunk/lib/ruby/2.7.0/tracer.rb:145:in `add_filter': wrong number of arguments (given 1, expected 0) (ArgumentError)

@k0kubun k0kubun requested a review from aycabta June 14, 2019 04:06
Copy link
Member

@aycabta aycabta left a comment

Choose a reason for hiding this comment

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

It's a very important fix for tests, thank you!

@aycabta aycabta merged commit 82f6dad into ruby:master Jun 29, 2019
@pocke pocke deleted the suppress-warnings branch June 29, 2019 15:22
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