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

Fix Kernel.p and Kernel.pp type with no argument #1342

Merged
merged 1 commit into from
Jul 14, 2023

Conversation

tompng
Copy link
Member

@tompng tompng commented May 25, 2023

Kernel.p(T) returns T, Kernel.p(*more_than_two) returns array, Kernel.p() retuns nil.
I added the missing definition () -> nil.

I think (*untyped arg0) -> Array[untyped] conflicts with (T arg0) -> T and () -> nil, so I changed it to (untyped, untyped, *untyped) -> Array[untyped]

# I referenced core/module.rbs
class Module < Object
  def public: () -> nil
            | (Symbol method_name) -> Symbol
            | (Symbol, Symbol, *Symbol method_name) -> Array[Symbol]
            | ...
end

| (*untyped arg0) -> Array[untyped]
| (untyped, untyped, *untyped) -> Array[untyped]
| () -> nil

Copy link
Collaborator

Choose a reason for hiding this comment

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

It appears that this line is the difference and the test is failing.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, I remove it

@soutaro soutaro added this to the RBS 3.2 milestone Jul 14, 2023
@soutaro soutaro added this pull request to the merge queue Jul 14, 2023
Merged via the queue into ruby:master with commit 82520f1 Jul 14, 2023
@tompng tompng deleted the fix/kernel-p-empty branch July 14, 2023 04:22
@soutaro soutaro added the Released PRs already included in the released version label Aug 18, 2023
@ksss ksss mentioned this pull request Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Released PRs already included in the released version
Development

Successfully merging this pull request may close these issues.

3 participants