The closest I could get to compile is to add exten...
# announcements
m
The closest I could get to compile is to add extension on value returned by
values()
, like this:
Copy code
interface Xable {

    val x: Int
}

enum class A(override val x: Int) : Xable

fun <T : Xable> Array<T>.of(x: Int) = single { it.x == x }