<Null Type Checking with Elvis Return> A student i...
# forum
r
Null Type Checking with Elvis Return A student in my CS1 course asked about the following example: fun test(values: IntArray?): Int? { if (values?.isEmpty() ?: true) { return null } return values.min() } As shown when the code is loaded into the Kotlin Playground, the compiler errors here on the final line, claiming that values is still nullable. But it doesn’t seem like it can be, since null values will end up in the right side of the Elvis...