Skip to content

Files

Latest commit

 

History

History
25 lines (16 loc) · 476 Bytes

ForbiddenVoid.md

File metadata and controls

25 lines (16 loc) · 476 Bytes

Pattern: Use of forbidden Void

Issue: -

Description

Kotlin type Unit should be used instead. This type corresponds to the Void class in Java and has only one value - the Unit object.

Example of incorrect code:

runnable: () -> Void
var aVoid: Void? = null

Example of correct code:

runnable: () -> Unit
Void::class

Further Reading