Build fix: nullable exhaustiveness checker is now only a part of other exhaustiveness checkers
This commit is contained in:
+10
@@ -6,6 +6,11 @@ fun nonExhaustiveBoolean(b: Boolean) = <error descr="[NO_ELSE_IN_WHEN] when expr
|
||||
false -> 0
|
||||
}
|
||||
|
||||
fun nonExhaustiveNullableBoolean(b: Boolean?) = <error descr="[NO_ELSE_IN_WHEN] when expression must be exhaustive, add necessary 'null' branch or 'else' branch instead">when</error>(b) {
|
||||
false -> 0
|
||||
true -> 1
|
||||
}
|
||||
|
||||
enum class Color {
|
||||
RED,
|
||||
GREEN,
|
||||
@@ -48,6 +53,11 @@ fun nonExhaustiveSealed(v: Variant) = <error descr="[NO_ELSE_IN_WHEN] when expre
|
||||
Variant.Singleton -> false
|
||||
}
|
||||
|
||||
fun nonExhaustiveNullableSealed(v: Variant?) = <error descr="[NO_ELSE_IN_WHEN] when expression must be exhaustive, add necessary 'Another', 'null' branches or 'else' branch instead">when</error>(v) {
|
||||
Variant.Singleton -> false
|
||||
is Variant.Something -> true
|
||||
}
|
||||
|
||||
sealed class Empty
|
||||
|
||||
fun nonExhaustiveEmpty(e: Empty) = <error descr="[NO_ELSE_IN_WHEN] when expression must be exhaustive, add necessary 'else' branch">when</error>(<warning>e</warning>) {}
|
||||
|
||||
Reference in New Issue
Block a user