Exhaustive whens without else and 'Nothing' as the result are considered 'implicit exhaustive'
This commit is contained in:
committed by
Mikhail Glukhikh
parent
d62d7dd84f
commit
b93894953d
+2
-2
@@ -4,10 +4,10 @@ sealed class Tree {
|
||||
class Node(val left: Tree, val right: Tree): Tree()
|
||||
|
||||
fun max(): Int {
|
||||
when(this) {
|
||||
<!DEBUG_INFO_IMPLICIT_EXHAUSTIVE!>when(this) {
|
||||
is Empty -> return -1
|
||||
is Leaf -> return <!DEBUG_INFO_SMARTCAST!>this<!>.x
|
||||
is Node -> return <!DEBUG_INFO_SMARTCAST!>this<!>.left.max()
|
||||
}
|
||||
}<!>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user