Inspectopedia
 
2024.3

Redundant 'Unit'

Warning
New
Last modified: 03 December 2024

Reports redundant Unit expressions.

Unit in Kotlin can be used as the return type of functions that do not return anything meaningful. The Unit type has only one possible value, which is the Unit object.

Examples: