[FIR] Report NON_EXHAUSTIVE_WHEN_STATEMENT/NO_ELSE_IN_WHEN for when's on logical types

^KT-47709 In Progress
This commit is contained in:
Dmitriy Novozhilov
2021-07-13 13:15:49 +03:00
committed by teamcityserver
parent ef635f6a96
commit a6edd852ff
38 changed files with 120 additions and 431 deletions
@@ -7,7 +7,7 @@ fun foo(my: My) {
if (my.x != null) {
// my.x should be smart-cast
if (my.x) doIt()
when (my.x) {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (my.x) {
true -> doIt()
}
when {
@@ -20,11 +20,11 @@ fun bar(x: Boolean?) {
if (x != null) {
// x should be smart-cast
if (x) doIt()
when (x) {
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (x) {
true -> doIt()
}
when {
x -> doIt()
}
}
}
}