Implicit exhaustive when check for definite variable initialization (KT-8700)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
52c3fb03a2
commit
011a9f23b9
@@ -3,10 +3,10 @@ enum class My { A, B }
|
||||
fun test(a: My): String {
|
||||
val q: String?
|
||||
|
||||
when (a) {
|
||||
<!DEBUG_INFO_IMPLICIT_EXHAUSTIVE!>when (a) {
|
||||
My.A -> q = "1"
|
||||
My.B -> q = "2"
|
||||
}
|
||||
}<!>
|
||||
// When is exhaustive
|
||||
return <!DEBUG_INFO_SMARTCAST!>q<!>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user