myaa
unresolved reference: value
is Match.HasMatch
sealed class Match { object NoMatch : Match() class HasMatch(value: Int) : Match() } fun main() { val x: Match? = null when (x) { Match.NoMatch -> println("no match") is Match.HasMatch -> println("value: ${x.value}") null -> println("null") } }
nanodeath
val
HasMatch
A modern programming language that makes developers happier.