[Serialization] Implement serialization checker for K2 version of plugin

^KT-53178 Fixed
This commit is contained in:
Dmitriy Novozhilov
2022-08-24 10:59:11 +03:00
committed by teamcity
parent e048ffcf6d
commit 671083c701
69 changed files with 1767 additions and 453 deletions
@@ -1,25 +1,24 @@
// FIR_IDENTICAL
// WITH_STDLIB
// SKIP_TXT
// !USE_EXPERIMENTAL: kotlinx.serialization.ExperimentalSerializationApi
// USE_EXPERIMENTAL: kotlinx.serialization.ExperimentalSerializationApi
// FILE: test.kt
import kotlinx.serialization.*
import kotlin.reflect.KClass
// TODO: for this test to work, runtime dependency should be updated to (yet unreleased) serialization 1.3.0
//@InheritableSerialInfo
@InheritableSerialInfo
annotation class I(val value: String)
enum class E { A, B }
//@InheritableSerialInfo
@InheritableSerialInfo
annotation class I2(val e: E, val k: KClass<*>)
@Serializable
@I("a")
sealed class Result {
// @I("b")
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I("b")<!>
@Serializable class OK(val s: String): Result()
}
@@ -35,15 +34,15 @@ open class Correct: A()
@Serializable
@I("a")
//@I2(E.B, E::class)
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.B, E::class)<!>
open class B: A()
@Serializable
@I("a")
//@I2(E.A, I::class)
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.A, I::class)<!>
open class B2: A()
@Serializable
//@I("b")
//@I2(E.A, E::class)
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I("b")<!>
<!INCONSISTENT_INHERITABLE_SERIALINFO!>@I2(E.A, E::class)<!>
open class C: B()