Hey, why do @IntDef have to be Long? wtf
# android
u
Hey, why do @IntDef have to be Long? wtf
t
I don't think they do?
u
for me its compiler error
t
Oh weird, it looks like @IntDef supports Int and Long and the way Kotlin works requires it to be Long - this was apparently addressed in the latest support annotations. https://github.com/android/android-ktx/issues/482 https://issuetracker.google.com/issues/37108545
u
thx
t
Though to be honest, the only reason @IntDef even exists is because Dalvik was horribly memory inefficient - making enums significantly more costly than constants, and Android used to be built for devices with as low as 64MB of RAM - enums are fine now and should be equivalent to constants with ART.
And I believe Kotlin enums are even more memory efficient.
u
Yea, I was porting some java code and ended up switching to enums
its just was strange af, but yea bug i guess
j
kotlin enums are not more efficient