is better for completeness check on enum/sealed class, or those cases where your
if
has at least 3 branches.
e
Eugen Martynov
04/09/2020, 12:55 PM
That was my assumptions, but is it common sence or written somewhere?
c
Cody Engel
04/09/2020, 1:41 PM
I don't know if it's been written down anywhere but it's implied. One advantage of the language is being concise, using the when is not as concise as say...
Copy code
if (check) println("it's true") else println("it's false")