Kernel#respond_to_missing? should return T::Boolean#7313
Kernel#respond_to_missing? should return T::Boolean#7313froydnj merged 1 commit intosorbet:masterfrom
Conversation
|
Unfortunately, given: https://github.com/ruby/ruby/blob/89802078f9f406be411032814e1960e62dbc7ce2/vm_method.c#L2852-L2867 I don't think we can guarantee that |
froydnj
left a comment
There was a problem hiding this comment.
Ah, sorry, I was confused about the previous bit.
|
@froydnj yeah, it looks like you are right. But it is very strange, they should cast it into boolean I think. |
|
We have a policy of testing changes to Sorbet against Stripe's codebase before Stripe employees can see the build results here: → https://go/builds/bui_Oe0ZC0Z03CpFET |
|
About this one: https://github.com/ruby/ruby/blob/89802078f9f406be411032814e1960e62dbc7ce2/vm_method.c#L2852-L2867 Based on the code it looks like Example class Example
def respond_to_missing?(*) = :sorbet
end
Example.new.respond_to?(:non_existing_method) => trueIt looks like it is working just fine. There is also test in ruby for that |
I think
Kernel#respond_to_missing?should return Boolean based on https://github.com/ruby/ruby/blob/89802078f9f406be411032814e1960e62dbc7ce2/vm_method.c#L2869-L2888Motivation
My codebase stop working because of this change.
https://github.com/LTe/acts-as-messageable/blob/d3b8574e9ed21aba7d61ef6f2d24a0539dd3e9b7/lib/acts_as_messageable/rails6.rb#L58-L61
The problem is with
supercall.Test plan
This should work:
https://sorbet.run/#%23%20typed%3A%20true%0Aextend%20T%3A%3ASig%0A%0Asig%20%7B%20params%28method_name%3A%20Symbol%2C%20include_private%3A%20T%3A%3ABoolean%29.returns%28T%3A%3ABoolean%29%20%7D%0Adef%20respond_to_missing%3F%28method_name%2C%20include_private%20%3D%20false%29%0A%20%20%5B%3Amethod_name%5D.include%3F%28method_name%29%20%7C%7C%20super%0Aend