Skip to content

Fix parser translation for a method with a &nil parameter and a body - #4371

Open
bbatsov wants to merge 1 commit into
ruby:mainfrom
bbatsov:fix-nil-block-param-forwarding
Open

bbatsov wants to merge 1 commit into
ruby:mainfrom
bbatsov:fix-nil-block-param-forwarding

Conversation

@bbatsov

@bbatsov bbatsov commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

find_forwarding called name on the block parameter, which NoBlockParameterNode doesn't have, so def foo(&nil); bar; end raised NoMethodError. An empty body never got that far, which is why the existing fixture didn't catch it.

Fixes #4370

`find_forwarding` asked the block parameter for its name, which
`NoBlockParameterNode` doesn't have, so any method taking `&nil` that
had a body raised NoMethodError.

Fixes ruby#4370

This branch has not been deployed

No deployments
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.

Prism::Translation::Parser raises NoMethodError for a method with a &nil parameter and a body

1 participant