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

Mutant does not handle ... argument forwarding correctly #1316

Closed
dgollahon opened this issue Apr 8, 2022 · 2 comments
Closed

Mutant does not handle ... argument forwarding correctly #1316

dgollahon opened this issue Apr 8, 2022 · 2 comments
Assignees

Comments

@dgollahon
Copy link
Collaborator

If you have a method such as:

def foo(...)
  bar(...)
end

mutant will mutate like this:

- def foo(...)
+ def foo

which raises a SyntaxError because bar(...) tries to incorrectly reference ... and results in

Killing the mutation resulted in an integration error.

I believe mutant needs to either never delete ... or check if it is used in the scope below.

I am using ruby 2.7.5, mutant-rspec 0.11.4, and parser 3.1.0.0

@dgollahon dgollahon added the bug label Apr 8, 2022
@mbj
Copy link
Owner

mbj commented Apr 9, 2022

correct, I think mutant should not delete ... easy fix,expect it this weekend.

@mbj mbj self-assigned this Apr 9, 2022
@mbj mbj added the mutation label Apr 9, 2022
mbj added a commit that referenced this issue Apr 10, 2022
[Fix #1316]

* Do not emit naked forward arg argument promotion
* Do not mutate away forard args, this would syntactically
  invalidate the generated source.
@mbj mbj closed this as completed in 7c6aee9 Apr 10, 2022
@mbj
Copy link
Owner

mbj commented Apr 10, 2022

@dgollahon this is fixed in release v0.11.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants