Currently antlr-kotlin code generator emits code like this:
override val ruleNames: Array<String> =
Rules.entries.map(Rules::name).toTypedArray()
override val channelNames: Array<String> =
Channels.entries.map(Channels::name).toTypedArray()
override val modeNames: Array<String> =
Modes.entries.map(Modes::name).toTypedArray()
They result in compilation error when we use Kotlin 1.9.x compiler, like:
e: file:///Users/atsushi/sources/KtMidi/mugene-ng/mugene-project/mugene/build/generatedAntlr/dev/atsushieno/mugene/parser/MugeneLexer.kt:128:15 This declaration needs opt-in. Its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'
Enum.entries seems part of experimental API in Kotlin 1.9.x, according to the Kotlin documentation:
Currently antlr-kotlin code generator emits code like this:
They result in compilation error when we use Kotlin 1.9.x compiler, like:
Enum.entries
seems part of experimental API in Kotlin 1.9.x, according to the Kotlin documentation:I have a fix for this, will create a PR.
Confirmed with 82ded4f