cedric
03/25/2018, 10:30 AMnull
as false
is pretty intuitive. Kotlin by design avoids implicit conversions as much as possible, which is why that code is invalid but I don't think it would lead to bugs or hard to read code to silently convert a null
Boolean
to false
kingsley
03/25/2018, 10:37 AMnull
and false
, and I’d rather avoid any implicit conversion between them.
In fact, I’d imagine someone using a nullable boolean probably wanted that distinction in the first placecedric
03/25/2018, 10:39 AMnull
or false
explicitly if the distinction matters to your code.kingsley
03/25/2018, 10:45 AMBoolean
and avoid any unnecessary implicits with the type system.
A Boolean?
on the other hand should force a distinction between null
and false