Repository navigation
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. |
soutaro
left a comment
There was a problem hiding this comment.
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#parameterswith 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::MethodArityMismatchandRuby::DifferentMethodParameterKind.What kind of checks should be attempted with RBS alone?