is there a compiler-flag to turn the generated war...
# announcements
t
is there a compiler-flag to turn the generated warning about a non-exhaustive
when
into an error? (i know i can turn the
when
statements themselves into expressions, but sometimes this gets forgotten)
a
You can just add
.let{}
at the end, to fake-use the result
t
as i said - i'm aware of that but i dont think its adequate
e
There's no compiler flag, as far as I know. However, if using external tools is an option for you, you may want to check this: https://proandroiddev.com/kotlin-when-statement-when-expression-oh-my-or-how-we-created-our-custom-detekt-rule-6f27e80bedaf
t
at leas tot should be easily possible to integrate detekt into our build pipeline. thank you!
👍 1
a
Also you could treat all warnings as errors with Werror compiler flag, but excluding warnings for this is not currently possible: https://youtrack.jetbrains.com/issue/KT-24746