Following the documentation, I created an enum class:
enum class BitCount public constructor(val value : Int){ x32(32), x64(64)}
Then, I'm trying to declare a variable in some function:
val bitCount : BitCount = BitCount(32)
But there is a compilation error:
Error:(18, 29) Kotlin: Enum types cannot be instantiated
How do I declare a variable of BitCount type and initialize it from an Int
?