enum class Entry { FOO, BAR, BAZ } fun test(e: Entry): Int { return when (e) { Entry.FOO -> 1 else -> 0 } }