Warning generation on non-exhaustive whens over enums + a set of tests + fixed test #KT-6227 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-05-28 15:28:13 +03:00
parent 969993bd09
commit de12771c0f
13 changed files with 318 additions and 5 deletions
@@ -0,0 +1,14 @@
// Base for KT-6227
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) {
X.A -> res = "A"
X.B -> res = "B"
X.C -> res = "C"
X.D -> res = "D"
}
return res
}