I don't know why detekt 1.0.0 flags the following with the UseCheckOrError rule:
fun zoneactionModelDir() = when (this) {
IN -> ZoneactionModel.Dir.IN
OUT -> ZoneactionModel.Dir.OUT
else -> throw IllegalStateException("Are you lost?")
}
How should I rewrite this one?
I think I can assist.
fun zoneactionModelDir() = when (this) {
IN -> ZoneactionModel.Dir.IN
OUT -> ZoneactionModel.Dir.OUT
else -> error("Are you lost?")
}
TIL!
Today I learned about TIL, thanks!
Most helpful comment
Today I learned about TIL, thanks!