Scala

Scala

Made by DeepSource

infix modifier is redundant for symbol-like methods SC-R1089

Anti-pattern
Major

infix modifier is a new modifier introduced in Scala 3 that can be applied to methods. This allows you to use the method as an infix operation. However, symbol-like methods are by default allowed in infix operations and do not require this modifier. Since this makes the modifier redundant, it is recommended that you drop the said modifier for such methods.

Bad Practice

infix def *(other: T): T = {
  // ...
}

Recommended

// `targetName` annotation is appropriate here, however.
def *(other: T): T = {
  // ...
}

Reference