muter icon indicating copy to clipboard operation
muter copied to clipboard

New mutation: swap true and false

Open ZevEisenberg opened this issue 6 years ago • 1 comments
trafficstars

Code like this:

foo = true // before
foo = false // after

Here’s a case where this could be better than just deleting lines with only side effects: you set the value to true, and true is the default, so removing the line does nothing, but negating the line does.

It is also useful for initializers and method parameters:

let x = foo(bar: true) // before
let x = foo(bar: false) // after

ZevEisenberg avatar Aug 07 '19 00:08 ZevEisenberg

Thanks for this @ZevEisenberg! We'll prioritize this once we start adding new mutation operators

SeanROlszewski avatar Aug 11 '19 16:08 SeanROlszewski