Skip to content

[prototype runtime] Find redefined methods#2542

Merged
ksss merged 1 commit intoruby:masterfrom
ksss:fix-prototype-todo
Jun 9, 2025
Merged

[prototype runtime] Find redefined methods#2542
ksss merged 1 commit intoruby:masterfrom
ksss:fix-prototype-todo

Conversation

@ksss
Copy link
Collaborator

@ksss ksss commented Jun 6, 2025

Since methods redefined in subclasses may have different types, I believe we should display the prototypes of such redefined methods when using --todo.

Repro

# sample.rb
class A
  def foo; 1; end
end
class B < A
  def foo; 'a'; end
end
# sample.rbs
class A
  def foo: () -> Integer
end
class B < A
end
$ bundle exec rbs -I sample.rbs prototype runtime --require-relative sample.rb --todo B

Actual

class B < ::A
end

Expect

class B < ::A
  def foo: () -> untyped
end

@soutaro soutaro added this to the RBS 4.0 milestone Jun 9, 2025
Copy link
Member

@soutaro soutaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ksss ksss added this pull request to the merge queue Jun 9, 2025
Merged via the queue into ruby:master with commit 2508852 Jun 9, 2025
22 checks passed
@ksss ksss deleted the fix-prototype-todo branch June 9, 2025 09:42
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.

2 participants