Skip to content

[Class] update class.rbs#2898

Open
sampersand wants to merge 3 commits intoruby:masterfrom
sampersand:master
Open

[Class] update class.rbs#2898
sampersand wants to merge 3 commits intoruby:masterfrom
sampersand:master

Conversation

@sampersand
Copy link
Contributor

@sampersand sampersand commented Mar 24, 2026

This closes soutaro/steep#2124 by updating class.rbs. Few important things to note that I'd like input on:

  1. I've added a [self: Class] to Class#initialize—it seems correct, but if we should remove that LMK

And other things to note:

  1. Technically Class defines both a singleton Class.allocate and an instance Class#allocate. I've gone ahead and included both for completeness, and it shouldn't matter
  2. inherited is now private (as it should be) and returns void (as nothing in Ruby uses its return value)
  3. new's signature now accepts anything
  4. attached_object still returns untyped

@ParadoxV5
Copy link
Contributor

  1. attached_object now returns an instance instead of untyped. Is this correct?

On second thought: It’s not correct.
It should be instance.instance (instance²), or T where self < singleton(T) (see #1542).

@sampersand
Copy link
Contributor Author

Yeah, i've just removed it entirely and it's now just untyped again

@sampersand sampersand marked this pull request as ready for review March 24, 2026 21:07
@soutaro soutaro added this to the RBS 4.1 milestone Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ensure all signatures for class.rbs are correct

3 participants