I have a simple enum class in which I would like to have a field called name.
enum class DeviceFieldQuery(val clazz: Class<*>) {
id(Int::class.java),
name(String::class.java),
}
Unfortunately, this does not seem to work in Kotlin. Compilation fails with the message:
Error:(9, 5) Kotlin: Conflicting declarations: enum entry name, public final val name: String
The same Enum class as Java code works fine. How may I solve this in Kotlin?