Skip to content

Add Numeric Node's check for parse rbs - #1711

Merged
soutaro merged 2 commits into
ruby:masterfrom
S-H-GAMELINKS:introduce/numeric-nodes
Jan 8, 2024
Merged

soutaro merged 2 commits into
ruby:masterfrom
S-H-GAMELINKS:introduce/numeric-nodes

Conversation

@S-H-GAMELINKS

Copy link
Copy Markdown
Contributor

I'll introduce Numeric Node's for the parser in ruby/ruby#9417.

This changed the behavior of the rbs parse process and caused the test to fail.

This pull request has been modified to check Numeric Node's in parse process.

@ksss ksss left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Great works!

Comment thread lib/rbs/prototype/rb.rb Outdated
Comment on lines +701 to +702
when :RATIONAL, :IMAGINARY
BuiltinNames::Numeric.instance_type

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How about to like this?

Suggested change
when :RATIONAL, :IMAGINARY
BuiltinNames::Numeric.instance_type
when :RATIONAL
Types::ClassInstance.new(name: TypeName("::Rational"), args: [], location: nil)
when :IMAGINARY
Types::ClassInstance.new(name: TypeName("::Complex"), args: [], location: nil)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the review!
I've fixed it in the following commit.
225ed22

@soutaro soutaro left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@soutaro soutaro added this to the RBS 3.5 milestone Jan 8, 2024
@soutaro
soutaro added this pull request to the merge queue Jan 8, 2024
Merged via the queue into ruby:master with commit c7e53d2 Jan 8, 2024
@S-H-GAMELINKS
S-H-GAMELINKS deleted the introduce/numeric-nodes branch January 8, 2024 15:29
@soutaro soutaro added the Released PRs already included in the released version label Jun 6, 2024
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants