Mutare.Mutators.IntegerCall (mutare v0.1.0)

Copy Markdown View Source

Swap complementary Integer calls for their opposite:

  • Integer.modInteger.floor_div — the two halves of floored division (mod is the remainder, floor_div the quotient); confusing one for the other is a classic off-by-operation bug
  • Integer.is_evenInteger.is_odd — the parity predicates

The integer-call sibling of Mutare.Mutators.Numeric/Math (and named like Mutare.Mutators.StringCall beside the Mutare.Mutators.IntegerLiteral value family, to keep "calls to Integer" distinct from "integer literals").

Integer.is_even/is_odd are guard-safe macros, so a swap in a when clause is mutated too. On by default. Matches aliased and bare-imported calls (alias Integer, as: I; I.is_evenI.is_odd), while a shadowing alias MyApp.Integer is left alone.