Reports calls that add or remove a java.nio.file.Path to/from a Kotlin collection or sequence using plus/minus, either in operator form (a + b, a - b) or regular call form (a.plus(b), a.minus(b)).

Since java.nio.file.Path implements Iterable<Path>, such calls resolve to the unexpected overload of the plus or minus function that takes a collection of elements (in this case, the individual elements of the Path). But the intent of the code is probably to add or remove the Path itself, not the individual elements.

Examples:


// Operator form
val paths = listOf(path) + somePath
val paths2 = setOf(path) - somePath

// Regular call form
val paths = listOf(path).plus(somePath)
val paths2 = setOf(path).minus(somePath)

Quick-fixes: