Open chloelbn opened 4 years ago
Hello @chloelbn, Thank you for opening this issue.
I think it is the intended behavior. I'm not 100% sure about these. Let me know if it's not correct.
def_delegators
method.I guess extend Forwardable
is missing in the Client
declaration in the .rbs file.
class Client
extend Forwardable
def get_task_status(String, String task_id, ?opts: Hash[untyped, untyped]) -> void
end
read
and write
method defined by def_delegators
call.The method definitions without def
syntax are also complicated. Because the tool doesn't know the implementation of def_delegators
. It doesn't know what the method will do for the class.
Steep (RBS) wants you to write them in RBS files.
class Client
extend Forwardable
def get_task_status(String, String task_id, ?opts: Hash[untyped, untyped]) -> void
def read: (Symbol, String, untyped, untyped opts) -> Response
def write: () -> Response
end
It is the design of RBS. The files contain everything type checkers need. RBS is the place everything is written down, and users and tools can understand your library with it.
I know meta programming doesn't work well with this design... but I haven't found a better way for it.
When using the
Forwardable
extension it seems likesteep check
doesn't recognize thedef_delegators
method and then the expected usage ofForwardable
inside the classRuby Class
Raised errors