Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't use Object#inspect in Kernel#method
As discussed already in #3373 some people might overwrite this in a way that's not compatible with the default behaviour. While we can't (and are not going to) guard ourselves against every possible case where somebody might've overwritten a core Ruby method, we _can_ at least in this particular case remove the dependency on Object#inspect. As an aside this now ensures that our error messages are the same as MRI's, although one could argue that this is a bit odd: class Foo end Foo.method(:bar) # => NameError: undefined method `barr' for class `Class' Instead of: Foo.method(:bar) # => NameError: undefined method `barr' for class `Foo'