-
Notifications
You must be signed in to change notification settings - Fork 215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve interface check by method parameters #1698
Conversation
I think the parameter checking should be permissive. Having an optional argument in implementation while required argument in RBS should be allowed for example. |
Steep validates the method implementation and reports |
Thank you! |
b7c205e
to
a9cd4d0
Compare
I have reimplemented code to allow for many method call patterns. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't review the implementation very carefully, but give it a try! 💪
Regarding checking interfaces, in addition to checking with
#respond_to?
, I believe that comparingMethod#parameters
with types can provide a more accurate interface check.As an implementation, I've made it so that a match only occurs if the method has exactly the same arguments as the type notation.
Does this match with the philosophy of RBS?
For example, the following code actually works.
However, for instance, steep would report
Ruby::MethodArityMismatch
andRuby::DifferentMethodParameterKind
.What kind of checks should be attempted with RBS alone?