-
Notifications
You must be signed in to change notification settings - Fork 225
Open
Description
I was hoping to use inline documentation to generate proper type signatures, but it doesn't seem to be working at the moment. I have a PR with everything set up to demonstrate here.
Here is the gist, though:
I expect that this calculator.rb file:
class Calculator
# @rbs (Integer, Integer) -> Integer
def add(a, b)
a + b
end
endAnd after running this command:
bin/rbs prototype rb lib/calculator.rb > sig/lib/calculator.rbsWould produce this sig/lib/calculator.rbs file:
class Calculator
def add: (Integer a, Integer b) -> Integer
endBut at the moment, it produces this:
class Calculator
# @rbs (Integer, Integer) -> Integer
def add: (untyped a, untyped b) -> untyped
endAll this with the current specs:
❯ ruby --version
ruby 3.2.7 (2025-02-04 revision 02ec315244) [arm64-darwin23]
❯ bundle info rbs
* rbs (4.0.0.dev.4 8a97819)
Summary: Type signature for Ruby.
Homepage: https://github.com/ruby/rbs
Source Code: https://github.com/ruby/rbs.git
Changelog: https://github.com/ruby/rbs/blob/master/CHANGELOG.md
Path: /Users/aemadrid/.local/share/mise/installs/ruby/3.2.7/lib/ruby/gems/3.2.0/bundler/gems/rbs-8a97819d4419Is this something that is in the works but not quite ready?
Tzrlk
Metadata
Metadata
Assignees
Labels
No labels