[FE 1.0] Report NON_EXHAUSTIVE_WHEN_STATEMENT/NO_ELSE_IN_WHEN for when's on logical types
^KT-47709 In Progress
This commit is contained in:
committed by
teamcityserver
parent
85c7f386eb
commit
ef635f6a96
@@ -1,4 +1,3 @@
|
||||
// FIR_IDENTICAL
|
||||
/*
|
||||
* KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE)
|
||||
*
|
||||
@@ -17,12 +16,11 @@ enum class X { A, B, C, D }
|
||||
|
||||
fun foo(arg: X?): String {
|
||||
var res = "XXX"
|
||||
// Should we report something here? Probably not, null is not an enum entry
|
||||
when (arg) {
|
||||
<!NON_EXHAUSTIVE_WHEN_STATEMENT!>when<!> (arg) {
|
||||
X.A -> res = "A"
|
||||
X.B -> res = "B"
|
||||
X.C -> res = "C"
|
||||
X.D -> res = "D"
|
||||
}
|
||||
return res
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user