Files
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

49 lines
974 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_STDLIB
// SKIP_TXT
// USE_EXPERIMENTAL: kotlinx.serialization.ExperimentalSerializationApi
// FILE: test.kt
import kotlinx.serialization.*
import kotlin.reflect.KClass
@InheritableSerialInfo
annotation class I(val value: String)
enum class E { A, B }
@InheritableSerialInfo
annotation class I2(val e: E, val k: KClass<*>)
@Serializable
@I("a")
sealed class Result {
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I("b")<!>
@Serializable class OK(val s: String): Result()
}
@Serializable
@I("a")
@I2(E.A, E::class)
open class A
@Serializable
@I("a")
@I2(E.A, E::class)
open class Correct: A()
@Serializable
@I("a")
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.B, E::class)<!>
open class B: A()
@Serializable
@I("a")
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.A, I::class)<!>
open class B2: A()
@Serializable
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I("b")<!>
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.A, E::class)<!>
open class C: B()