// MyEnum: to be implemented impl enum class MyEnum { FIRST, SECOND, LAST; companion object { fun byNum(num: Int): MyEnum = when (num) { 1 -> FIRST 2 -> SECOND else -> LAST } } impl val num: Int get() = TODO("not implemented") //To change body of created functions use File | Settings | File Templates. }