Pattern: Use of forbidden Void
Issue: -
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