Implicit exhaustive when check for definite variable initialization (KT-8700)
This commit is contained in:
committed by
Mikhail Glukhikh
parent
52c3fb03a2
commit
011a9f23b9
@@ -7,10 +7,10 @@ enum class E {
|
||||
class Outer(e: E) {
|
||||
private val prop: Int
|
||||
init {
|
||||
when(e ) {
|
||||
<!DEBUG_INFO_IMPLICIT_EXHAUSTIVE!>when(e ) {
|
||||
// When is exhaustive, property is always initialized
|
||||
E.A -> prop = 1
|
||||
E.B -> prop = 2
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user