Closed DadiBit closed 3 months ago
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.
Hi @DadiBit, the main reason for not using native enum is the performance penalty of using it as compared to primitives (or inline classes). The library focus on performance over ergonomics, so we are in favor of improving the ease of use only if the performance trade of is worth it.
Using the built-in
enum class
kotlin's enum implementation makes the final code easier to read, cleaner, more standard.To stay backward compatible, I had to add a "name" method and a "names" property. Same story goes for the
operator invoke
, which replaces the old class constructor.Notes:
JvmInline
annotation be an issue? I'm "against" using it in the first place, since it's KMP, not Kotlin on JVM.sourceName
, which can be eitehr retrieved withsomeEntry.sourceName
orsomeClass.name(someEntry)