This inspection became deprecated.
It is not recommended to use procedure-like syntax for methods with Unit
return type. It is inconsistent,
may lead to errors and will be deprecated in future versions of Scala.
* Reference: The talk "Scala with Style" by Martin Odersky at
ScalaDays 2013
Old description:
Methods with a result type of Unit are only executed for their side effects.
A better way to express such methods is to leave off the result type and the equals sign,
and enclose the body of the method in curly braces.
In this form, the method looks like a procedure, a method that is executed only
for its side effects:
// excessive clutter, looks like a function
def close(): Unit = { file.delete() }
// concise form, side-effect is clearly stated
def close() { file.delete() }
* Refer to Programming in Scala, 4.1 Classes, fields, and methods