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

Union#to_s should follow RBS/Lint/AmbiguousOperatorPrecedence #2231

Merged
merged 2 commits into from
Jan 15, 2025

Conversation

tk0miya
Copy link
Contributor

@tk0miya tk0miya commented Jan 13, 2025

At present, the result of Union#to_s does not respect RBS/Lint/AmbiguousOperatorPrecedence cop from rubocop-on-rbs.

It would be better to wrap intersections in unions by paranthesis.

  • Before: Integer | String & bool
  • After: Integer | (String & bool)

ref: soutaro/rbs-inline#174

@tk0miya tk0miya changed the title Union#to_s follows RBS/Lint/AmbiguousOperatorPrecedence Union#to_s should follow RBS/Lint/AmbiguousOperatorPrecedence Jan 13, 2025
At present, the result of `Union#to_s` does not respect
`RBS/Lint/AmbiguousOperatorPrecedence` cop from rubocop-on-rbs.

It would be better to wrap intersections in unions by paranthesis.

* Before: `Integer | String & bool`
* After:  `Integer | (String & bool)`

ref: soutaro/rbs-inline#174
@tk0miya
Copy link
Contributor Author

tk0miya commented Jan 13, 2025

I posted #2232 to resolve the CI problems.

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.

👍

@soutaro soutaro added this pull request to the merge queue Jan 15, 2025
Merged via the queue into ruby:master with commit 5c48490 Jan 15, 2025
19 checks passed
@tk0miya tk0miya deleted the Union.to_s branch January 15, 2025 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants