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

internal/gogrep: allow f($*_) to match variadic calls #239

Merged
merged 1 commit into from
Jun 5, 2021

Conversation

quasilyte
Copy link
Owner

We rename CallExpr to NonVariadicCallExpr -- it rejects variadic calls.
We keep VariadicCallExpr as is.
We introduce a new CallExpr op that matches both normal and variadic calls.

CallExpr is generated for call patterns that should accept both kinds of calls.
So if the last pattern argument is seq match var, we emit CallExpr.

Fixes #237

We rename `CallExpr` to `NonVariadicCallExpr` -- it rejects variadic calls.
We keep `VariadicCallExpr` as is.
We introduce a new `CallExpr` op that matches both normal and variadic calls.

`CallExpr` is generated for call patterns that should accept both kinds of calls.
So if the last pattern argument is seq match var, we emit `CallExpr`.

Fixes #237
@quasilyte quasilyte force-pushed the quasilyte/fix/variadic_func_matching branch from 061fba2 to 7475ca2 Compare June 5, 2021 12:16
@quasilyte quasilyte merged commit fc40544 into master Jun 5, 2021
@quasilyte quasilyte deleted the quasilyte/fix/variadic_func_matching branch June 5, 2021 12:42
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.

variadic "..." breaks the matching "$*_"
1 participant