-
Notifications
You must be signed in to change notification settings - Fork 660
Description
These functions:
kotlinx.serialization/core/commonMain/src/kotlinx/serialization/internal/Enums.kt
Line 83 in 4bf4113
internal fun <T : Enum<T>> createAnnotatedEnumSerializer( kotlinx.serialization/core/commonMain/src/kotlinx/serialization/internal/Enums.kt
Line 54 in 4bf4113
internal fun <T : Enum<T>> createSimpleEnumSerializer(serialName: String, values: Array<T>): KSerializer<T> {
are internal
, but the kotlinx.serialization compiler plugin generates calls to these functions in user code. This is access violation.
Why this is important to us (the Kotlin compiler team): we're trying to enable visibility checks during IR validation in the compiler. Basically, these checks try to ensure that e.g. an internal function is only ever called from the same module it's declared in. We're trying to enable these checks in compiler tests, however, the kotlinx.serialization-related tests are failing because of access violations.
We suggest annotating these functions (and potentially other internal
functions, calls to which may be emitted into user code by the compiler plugin) as @PublishedApi
, or making them public.