Skip to content


Optional argument in between regular arguments does not get reproduced #31

Gibheer opened this Issue · 2 comments

2 participants


When having a function with an optional argument in the list of arguments the order gets destroyed.

def foo(bar1, bar2 = false, bar3)

gets converted to

def foo(bar1, bar3)

An example can be found here:

git clone
bundle install
mutant -I lib --rspec-dm2 -r zero "::Zero::Renderer#initialize"

This is a so called "noop fail". Prior to mutations on a subject mutant injects unmodified code (or at least what it thinks is unmodified code) to test the AST to source converter. This is basically a bug on to_source.

ToSource.to_source('def foo(bar, baz=:fuu, other; end'.to_ast) => "def foo(bar, other)"

This is fixed with the upcoming release. See mbj/unparser@13168f5

@mbj mbj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.