class Sorbet::Private::Serialize

def ancestor_has_method(method, klass)

def ancestor_has_method(method, klass)
  return false if !Sorbet::Private::RealStdlib.real_is_a?(klass, Class)
  first_ancestor = klass.ancestors.find do |ancestor|
    next if ancestor == klass
    begin
      ancestor.instance_method(method.name)
    rescue NameError
      nil
    end
  end
  return false unless first_ancestor
  first_ancestor.instance_method(method.name).parameters == method.parameters
end