I'm having trouble using a cinteropt enum in my Kotlin code. Given the following C header:
typedef enum
{
BCM2835_GPIO_FSEL_INPT = 0x00,
...
} bcm2835FunctionSelect;
I have added this as a strictEnum to `libbcm.def`:
strictEnums = bcm2835FunctionSelect
Then when I try to use it in Kotlin code, there are two issues. Firstly, I have to use it rather verbosely:
bcm2835_gpio_fsel(pin, bcm2835FunctionSelect.BCM2835_GPIO_FSEL_INPT.value.toUByte());
And secondly it doesn't compile, with the following error:
e: kotlin.UninitializedPropertyAccessException: Parent not initialized: org.jetbrains.kotlin.ir.declarations.impl.IrEnumEntryImpl@31d85176
at org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase.getParent(IrDeclarationBase.kt:39)
at org.jetbrains.kotlin.ir.util.IrUtilsKt.getParentAsClass(IrUtils.kt:286)
at org.jetbrains.kotlin.backend.konan.ir.interop.cenum.CEnumCompanionGenerator.generateAliasGetterBody(CEnumCompanionGenerator.kt:84)
It looks like I've found a bug, but maybe I'm doing something wrong?