Files
kotlin-fork/plugins/kotlinx-serialization/testData/diagnostics/EnumDuplicateSerialName.kt
T
Sergey.Shanshin 2ae2f09fee [FIR] Fixed phase for FirCompanionGenerationProcessor to COMPANION_GENERATION
Phase COMPILER_REQUIRED_ANNOTATIONS causes errors in the kotlinx serialization tests:

org.jetbrains.kotlin.fir.symbols.FirLazyResolveContractViolationException: `lazyResolveToPhase(COMPILER_REQUIRED_ANNOTATIONS)` cannot be called from a transformer with a phase COMPILER_REQUIRED_ANNOTATIONS.
`lazyResolveToPhase` can be called only from a transformer with a phase which is strictly greater than a requested phase;
 i.e., `lazyResolveToPhase(A)` may be only called from a lazy transformer with a phase B, where A < B. This is a contract of lazy resolve
2024-02-12 15:54:11 +00:00

30 lines
520 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_STDLIB
// SKIP_TXT
import kotlinx.serialization.*
@Serializable
enum class ImplicitlyDuplicated {
@SerialName("foo")
FIRST,
<!DUPLICATE_SERIAL_NAME_ENUM!>@SerialName("foo")<!>
SECOND
}
@Serializable
enum class ExplicitlyDuplicated {
FIRST,
SECOND,
<!DUPLICATE_SERIAL_NAME_ENUM!>@SerialName("FIRST")<!>
THIRD
}
@Serializable
enum class ReversedExplicitlyDuplicated {
<!DUPLICATE_SERIAL_NAME_ENUM!>@SerialName("THIRD")<!>
FIRST,
SECOND,
THIRD
}