I am using enum as a parameter and I am getting this error
error: as of release 5, 'enum' is a keyword, and may not be used as an identifier
private final kotlin.jvm.functions.Function1<com.tylertech.newworld.mobility.enum.CustomAlertDialogEvents, kotlin.Unit> itemClicked = null;
Below Is my enum class
enum class CustomAlertDialogEvents(var resId: Int, val value: Int) {
ACTION_OPEN_SETTINGS(R.string.open, 0),
ACTION_CLOSE_SETTINGS(R.string.close, 1)
}
And I am using like this
private val itemClicked: (CustomAlertDialogEvents) -> Unit
Any ideas why this error is coming?
UPDATE
Image below shows I am using this convention and it is working for every other case.

You have enum as part of your package name. enum is also a keyword in java and you cannot use keywords in package names. Rename your package e.g. to enums.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With