anyone have a particularly clean way to ensure tha...
# codingconventions
k
anyone have a particularly clean way to ensure that a
when
whose result you don't care about is exhaustive? I could store it into a variable (and explicitly suppress the unused lint warning), or chain an empty, unused
.run {}
on it, presumably. Anyone have any less weird ways?
k
kevinmost: there was a discussion about this the other day
in short: you can make an extension function
fun Any?.exhaustive() {}
that will force a when statement to be an expression