Ruckus
07/19/2019, 8:01 PMvoid
return as Nothing
instead of Unit
?Bob Glamm
07/19/2019, 10:07 PMvoid
is isomorphic to Unit
- they are both sets with exactly one element - whereas Nothing
is a set with zero elements. There would be no way for Java to interoperate with Kotlin if Nothing
was used in place of void
.Ruckus
07/19/2019, 10:10 PMBob Glamm
07/19/2019, 10:14 PMRuckus
07/19/2019, 10:24 PMBob Glamm
07/19/2019, 10:35 PMRuckus
07/19/2019, 10:35 PMBob Glamm
07/19/2019, 10:36 PMRuckus
07/19/2019, 10:38 PMinline fun diverge(op: () -> Unit): Nothing {
op()
error("Cannot be reached")
}
Bob Glamm
07/19/2019, 10:38 PMRuckus
07/19/2019, 10:39 PM