Add signatures for the `main` object
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 2.2k
- Forks
- 256
- Avg merge
- 6d 17h
- Merged PRs (30d)
- 37
Description
Hello. The using method at the top level seems not typed. Is there a way to resolve it?
Reprodoction
The following is a reproduction using Steep. First, prepare a few files.
a.rb:
using Module.new
Steepfile:
target :test do
check "a.rb"
end
Gemfile:
source "https://rubygems.org"
gem "steep", "1.2"
gem "rbs", "2.7"
Then, install the gems and run steep on your terminal:
$ bundle config set --local path vendor/bundle
$ bundle install
$ bundle exec steep check
You should see the following output:
a.rb:1:0: [error] Type `::Object` does not have method `using`
│ Diagnostic ID: Ruby::NoMethod
│
└ using Module.new
~~~~~
Detected 1 problem from 1 file
Environment
- ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
- rbs
2.6.02.7.0 - steep
1.1.01.2.0
Note
The Module#using method signature has been existing already:
https://github.com/ruby/rbs/blob/95667d76c725566fa455bbcca0c10cc1e539475a/core/module.rbs#L1519
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with a.rb, Steepfile, and Gemfile using the documented Steep command. Compare the existing Module#using signature in core/module.rbs with the signatures available to the top-level main object; done means steep check accepts using Module.new without the reported Ruby::NoMethod error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100