Scala

Scala

Made by DeepSource

Unary methods should not have any parentheses/take any arguments SC-R1079

Anti-pattern
Major

Unary methods in Scala are special methods that are used to define unary operators on types. Because unary operators do not take in any arguments and operate on a single entity, declarations of such operators should not define parameters, or have parentheses either.

Bad Practice

def unary_!(): T = {
  // ...
}

Recommended

def unary_! : T = {
  // ...
}