Join Slack
Powered by
Hello, do Kotlin enums become real ObjC enums (whi...
# kotlin-native
g
galex
09/04/2019, 1:00 PM
Hello, do Kotlin enums become real ObjC enums (which are objects after all) or are they like real enums (two values share the same memory instance?
k
Kris Wong
09/04/2019, 1:20 PM
this is how a Kotlin enum gets exported
Untitled
g
galex
09/04/2019, 1:26 PM
I have a hard time reading this, do you know if two “instances” of “alpha” would each occupy their own memory zone or would they both occupy the same one?
k
Kris Wong
09/04/2019, 1:30 PM
they are class properties. i.e., static
g
galex
09/04/2019, 1:41 PM
Thank you I’ll go read about that
b
basher
09/04/2019, 1:58 PM
Obj-C enums are C enums
s
Sam
09/04/2019, 1:58 PM
FYI, ObjC enums are not objects. They are actually C enums which are backed by Ints by default.
https://stackoverflow.com/questions/48986767/different-ways-of-declaring-enum-in-objective-c
b
basher
09/04/2019, 1:59 PM
This is closer to the ordinal property of a kotlin enum
g
galex
09/04/2019, 2:23 PM
Interesting, thanks
2
Views
Open in Slack
Previous
Next