Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support main object #2361

Open
ksss opened this issue Mar 26, 2025 · 0 comments
Open

Support main object #2361

ksss opened this issue Mar 26, 2025 · 0 comments

Comments

@ksss
Copy link
Collaborator

ksss commented Mar 26, 2025

RBS & Steep does not handle the main object well.

# sample.rb
using Foo
sample.rb:1:0: [error] Type `::Object` does not have method `using`
│ Diagnostic ID: Ruby::NoMethod
│
└ using Foo
  ~~~~~

Problem

Steep (1.10.0) treats main object as Object.

Proposal

We propose to introduce RBS::Unnamed::TopLevelSelfClass.
This is modeled on ENV and ARGF.

class RBS::Unnamed::TopLevelSelfClass
  def using: (Module arg0) -> self
end

Steep

Use RBS::Unnamed::TopLevelSelfClass as the main object in Steep.

Reference

#2357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant