Skip to content

Fix syntax error in all cases where & is a param.#7509

Merged
enebo merged 1 commit intojruby:masterfrom
enebo:fix_after_rest_arg_error
Dec 2, 2022
Merged

Fix syntax error in all cases where & is a param.#7509
enebo merged 1 commit intojruby:masterfrom
enebo:fix_after_rest_arg_error

Conversation

@enebo
Copy link
Member

@enebo enebo commented Dec 2, 2022

The primary fix here is to make a new subtype to tell whether we are using FWD_BLOCK or not (ForwaringBlockArgNode). Secondary clarifier is to make ANON_BLOCK to complement FWD_BLOCK (both are '&').

The irony of the check is this is for a warning of something like: def foo(*r, ...); end

Notice '&' is not even in this signature. They use existence of '&' as a proxy for '...'.

Fixes #7506

The primary fix here is to make a new subtype to tell whether we are using
FWD_BLOCK or not (ForwaringBlockArgNode).  Secondary clarifier is to make
ANON_BLOCK to complement FWD_BLOCK (both are '&').

The irony of the check is this is for a warning of something like:
def foo(*r, ...); end

Notice '&' is not even in this signature.  They use existence of '&' as
a proxy for '...'.
@enebo enebo added this to the JRuby 9.4.1.0 milestone Dec 2, 2022
@enebo enebo merged commit 46fa40a into jruby:master Dec 2, 2022
@enebo enebo deleted the fix_after_rest_arg_error branch December 19, 2022 18:25
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.

JRuby 9.4.0.0 Anonymous block argument after a splat is broken

1 participant