If I try to type:
enum class EGraphicsAPIConvention(@get:JvmName("i") val i: Int) {
API_DirectX(0),
API_OpenGL(1)
}
fun EGraphicsAPIConvention.of(i: Int) = values().first { it.i == i }
The compiler complains:
unresolved reference values
this.values()
doesn't help neither
Why don't I have values()
available?