https://kotlinlang.org logo
Title
e

elect

08/02/2018, 5:54 PM
we need inline enums, please vote guys https://youtrack.jetbrains.com/issue/KT-23823
k

karelpeeters

08/02/2018, 5:56 PM
It already has a target version so looks like it's accepted already?
m

Markchous

08/02/2018, 6:07 PM
What would the use case of an inline enum be? Is it just for convenience factor?
k

karelpeeters

08/02/2018, 6:08 PM
And out curiosity, is there a big performance difference? They are mostly compared and used by reference, so their class-like nature shouldn't really matter much.
r

robstoll

08/02/2018, 6:43 PM
How would an inlined enum be represented? By their
ordinal
?
k

karelpeeters

08/02/2018, 6:45 PM
There's a bit about enums here: https://github.com/Kotlin/KEEP/issues/104
But probably ordinals, there's not much else to use.
a

ankushg

08/02/2018, 9:41 PM
Dropped a comment in support. Here's my use case for inline enums: https://kotlinlang.slack.com/archives/C0B8L3U69/p1533092140000170
g

gildor

08/03/2018, 3:05 AM
Inline enums for JS is probably good idea. We already had this discussion before, I still highly doubt that you can get any measurable performance gain comparing with Enums + EnumSet on JVM.
e

elect

08/03/2018, 6:06 AM
@karelpeeters, it looks like there is no definitive plan for inline enums, https://github.com/Kotlin/KEEP/issues/104#issuecomment-410010541