Skip to content

Support main object #2361

@ksss

Description

@ksss

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions