Trevoke
Trevoke

Reputation: 4117

"method redefined" warning: unclear why it exists, unclear if I can fix it on my end

I added sorbet to a pet project of mine: https://github.com/Trevoke/SGFParser

When I run the tests, I get a lot of the following warning (here's a link to a travis-ci build):

/Users/trevoke/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/sorbet-runtime-0.4.4314/lib/types/private/methods/call_validation.rb:807: warning: method redefined; discarding old add_error

/Users/trevoke/.rbenv/versions/2.6.0/lib/ruby/gems/2.6.0/gems/sorbet-runtime-0.4.4314/lib/types/private/methods/_methods.rb:127: warning: previous definition of add_error was here

Where "add_error" is a method of mine -- the other warnings show different method names.

I'd like to know if this is something which belongs entirely on the sorbet side or whether I can do something to get rid of them.

Upvotes: 1

Views: 1033

Answers (1)

marianosimone
marianosimone

Reputation: 3606

There doesn't seem like you can do anything on your side right now. It might be related to Sorbet#1150: "sorbet-runtime causes many warnings with Ruby $VERBOSE mode".

There's an open PR (Sorbet#1266) that could help.

Upvotes: 2

Related Questions