Skip to content

Correctly handle and? and similar on ruby 4.0#3966

Merged
kddnewton merged 1 commit intoruby:mainfrom
Earlopain:and-predicate
Mar 5, 2026
Merged

Correctly handle and? and similar on ruby 4.0#3966
kddnewton merged 1 commit intoruby:mainfrom
Earlopain:and-predicate

Conversation

@Earlopain
Copy link
Collaborator

It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925 But it actually should be a plain method call.
!/? are not valid as part of an identifier, methods however allow them as the last character.

Fixes [Bug #21946]

or 3

1
andfoo
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This should be true on all versions, not just 4.0. I moved it out to the non-version-specific fixture.

It gets confused for syntax introduced in https://bugs.ruby-lang.org/issues/20925
But it actually should be a plain method call.
`!`/`?` are not valid as part of an identifier, methods
however allow them as the last character.

Fixes [Bug #21946]
@kddnewton kddnewton merged commit 5d80bc5 into ruby:main Mar 5, 2026
67 checks passed
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