Michael de Kaste
09/19/2022, 8:27 AM.single()
, I would expect there to be function that does this:
• If there are no elements: null
• If there is one element: it
• If there are more elements: exception
However, the implementation .singleOrNull()
returns null on multiple elements too.
There have been several occassions where we now check size first and manually do a 0,1,else check to do this correctly, but am I just missing something or should I just do a language proposal?Joffrey
09/19/2022, 8:35 AMMichael de Kaste
09/19/2022, 8:37 AM