Sign in
pigweed
/
third_party
/
github
/
JetBrains
/
kotlin
/
5e49b472f81ed95098eec9749aa2ad0415fac731
/
.
/
compiler
/
testData
/
diagnostics
/
tests
/
sealed
/
TreeWhenFunctional.fir.kt
blob: 38c058814d579ee7c00cf7f2f498ca0df8dac71b [
file
]
sealed
class
Tree
{
object
Empty
:
Tree
()
class
Leaf
(
val x
:
Int
):
Tree
()
class
Node
(
val left
:
Tree
,
val right
:
Tree
):
Tree
()
fun max
():
Int
=
when
(
this
)
{
is
Empty
->
-
1
is
Leaf
->
this
.
x
is
Node
->
this
.
left
.
max
()
}
}