Open jasonbuehler opened 9 months ago
Thanks @matteodepalo , I appreciate it! I have also been seeing other cases of api calls returning the Sorbet private VOID type, such as when I update an api order object using .save (REST), not sure if that's also related, but it doesn't seem like that type should really ever be returned from a method. Not sure if mentioning it here is sufficient or if I should be opening another ticket for that as well, seems like it could also be related to this.
Issue summary
When using
api_object.respond_to?(:method_name)
the lib sometimes returnstrue
and sometimes returnsT::Private::Types::Void::VOID
Sorbet private void type. It seems that true was returned if the method name had been previously used to dereference the object but on more inspection I am not so sure that's the case.shopify_api
version: 13.4Expected behavior
When calling
respond_to?
with a method name the object should returntrue
if the object is able to respond to the method call orfalse
if it is not, and if you call the method name on the object after it returns false it should raise aNoMethodError
Actual behavior
Sometimes the response is
true
, sometimes it's a private Sorbet typeT::Private::Types::Void::VOID
, and sometimes it switches from the private type to true after you dereference the object with the method in question.Steps to reproduce the problem
respond_to?
on it (api_object.respond_to? :some_bs_method
)respond_to?
with the method name, it was returning true for me after doing so