Skip to content

[ruby-4.0] Fix not binding power in endless methods#3999

Merged
k0kubun merged 1 commit into
ruby:ruby-4.0from
k0kubun:ruby-4.0
Mar 16, 2026
Merged

[ruby-4.0] Fix not binding power in endless methods#3999
k0kubun merged 1 commit into
ruby:ruby-4.0from
k0kubun:ruby-4.0

Conversation

@k0kubun
Copy link
Copy Markdown
Member

@k0kubun k0kubun commented Mar 16, 2026

Backport #3982 to ruby-4.0

ref: ruby/ruby@6b47e3f

[Bug #21097]

Change rescue modifier binding power from PM_BINDING_POWER_COMPOSITION
to PM_BINDING_POWER_MATCH + 1, so that `x = a rescue b in c` is parsed
as `(x = (a rescue b)) in c` and `def f = a rescue b in c` is parsed
as `(def f = (a rescue b)) in c`.
@k0kubun k0kubun merged commit 9a12354 into ruby:ruby-4.0 Mar 16, 2026
38 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