extend module in RBS sig not declaring module instance methods as singleton methods of extended module
This can be tested with the following code:
module B
def foo
"foo"
end
end
module A
module_function
extend B
def bar
foo
end
end
A.bar
module B
def foo: () -> String
end
module A
extend B
def self?.bar: () -> String
end
this produces the following steep error:
Type `(::Object & ::A)` does not have method `foo` (Ruby::NoMethod)
I checked that, in latest rbs, foo does get added as a singleton method of module A, so it should be available for steep to use.
I could not reproduce the problem in my environment. Please let me know your environment.
My environment is here.
* rbs (3.9.1)
* steep (1.10.0)
@ksss you're right, updated the example. was under the impression that the outer call would also fail, but it seems that the error only pops up if using the function from another module function.
Since def bar appears to be an instance method, foo also looks like an instance method call. The warning seems to be correct.
again, my bad. Corrected. The module_function call was missing. same outcome.
Thank you, I reproduced it.
Perhaps steep is not able to support module_function.
Supporting it would solve this issue.