Yes it is possible!
In Kotlin, enum instances can be imported, like most other things, so if enum class E is in the default package, you can simply add import E.*to the top of the source file that you would like to use its instances directly. For instance:
import E.*
val a = A
Each instance can also be imported separately, and not just import everything into an enumeration:
import E.A
import E.B
This also works, even if the enumeration is declared in the same file:
import E.*
enum class E{A,B}
val a = A
source
share