Swift edition
Operators
An operator is a kind of change; each mutant is one operator applied at one place. The Swift edition uses the other editions’ ids wherever the meaning is the same, so a rule, a script or an agent that names mutastic/boundary means one thing in all three, and adds three of Swift’s own, under swift/.
A run uses defaults unless --operators says otherwise: --operators=stronger adds the stronger set to the defaults, --operators=extended or all adds Swift’s own too, and a list of ids separated by commas picks exactly those. Each card links to its operator’s section here.
- Conditions: comparisons, conditions, and how two combine.
- Arithmetic: operators, signs and bits.
- Returns and errors: what a function returns, and what a
trydoes. - Calls and writes: calls, assignments and writes left out.
- Arguments: what a call is given.
- Library methods: the standard library’s methods swapped for their counterparts.
- Iterators: a chain’s matches and stages, where the Java edition has streams.
- Optionals:
??and optional chains, where the Java edition hasOptional.
Every operator
Section titled “Every operator”| Operator | Set | Page |
|---|---|---|
mutastic/boundary | defaults | Conditions |
mutastic/remove-conditional | defaults | Conditions |
mutastic/logical-connector | defaults | Conditions |
mutastic/comparison | stronger | Conditions |
mutastic/other-comparison | stronger | Conditions |
swift/remove-guard | extended | Conditions |
mutastic/math | defaults | Arithmetic |
mutastic/other-arithmetic | stronger | Arithmetic |
mutastic/remove-negation | stronger | Arithmetic |
mutastic/bitwise | stronger | Arithmetic |
mutastic/return-value | defaults | Returns and errors |
mutastic/unwrap-try | defaults | Returns and errors |
swift/try-nil | extended | Returns and errors |
mutastic/remove-void-call | defaults | Calls and writes |
mutastic/remove-discarded-call | defaults | Calls and writes |
mutastic/remove-assignment | defaults | Calls and writes |
mutastic/remove-field-write | stronger | Calls and writes |
mutastic/boolean-constant | stronger | Arguments |
library/swap-string | defaults | Library methods |
library/swap-math | defaults | Library methods |
library/swap-ends | stronger | Library methods |
library/swap-index-of | stronger | Library methods |
stream/swap-match | defaults | Iterators |
stream/remove-stage | defaults | Iterators |
optional/no-default | stronger | Optionals |
optional/always-default | stronger | Optionals |
swift/chain-nil | extended | Optionals |