Generates an added _ordinal field for every Kotlin Enum that can be accessed through fbjni.
Previously, we accessed ordinal, which should've been available in every Kotlin enum, but apparently some people had issues with this (@Szymon20000 & @shovel-kun) - maybe it got compiled out? Maybe it was an older Kotlin version? Maybe it got replaced with a ordinal() method for some reason? I don't know. I couldn't reproduce this bug.
Anyways; the smartest solution I can find that didn't degrade performance (calling ordinal() method thru JNI is slower than accessing a field) is that we just create a shadow-property on the Kotlin enum called _ordinal which mirrors whatever state the parent ordinalvalue or method has.
This can then be accessed directly from JNI as a field.
Generates an added
_ordinal
field for every Kotlin Enum that can be accessed through fbjni.Previously, we accessed
ordinal
, which should've been available in every Kotlin enum, but apparently some people had issues with this (@Szymon20000 & @shovel-kun) - maybe it got compiled out? Maybe it was an older Kotlin version? Maybe it got replaced with aordinal()
method for some reason? I don't know. I couldn't reproduce this bug.Anyways; the smartest solution I can find that didn't degrade performance (calling
ordinal()
method thru JNI is slower than accessing a field) is that we just create a shadow-property on the Kotlin enum called_ordinal
which mirrors whatever state the parentordinal
value or method has.This can then be accessed directly from JNI as a field.