Correctly handle @Repeatable @SerialInfo annotations on classes

that were affected by deduplication of inherited serial info annotations.

Prohibit combination of @InheritableSerialInfo and @Repeatable.

Fixes https://github.com/Kotlin/kotlinx.serialization/issues/2099
This commit is contained in:
Leonid Startsev
2023-03-17 16:57:31 +01:00
committed by Space Team
parent 8b12b3f18d
commit 6ee20574e1
13 changed files with 125 additions and 4 deletions
@@ -0,0 +1,22 @@
// FIR_DISABLE_LAZY_RESOLVE_CHECKS
// FIR_IDENTICAL
// SKIP_TXT
// WITH_STDLIB
// FULL_JDK
import kotlinx.serialization.*
<!INHERITABLE_SERIALINFO_CANT_BE_REPEATABLE!>@InheritableSerialInfo<!>
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY)
@Repeatable
annotation class RepeatableSerialInfo(val value: Int)
<!INHERITABLE_SERIALINFO_CANT_BE_REPEATABLE!>@InheritableSerialInfo<!>
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY)
@java.lang.annotation.Repeatable(JavaRepeatableContainer::class)
annotation class JavaRepeatable(val value2: Int)
@Target(AnnotationTarget.CLASS, AnnotationTarget.PROPERTY)
annotation class JavaRepeatableContainer(val value: Array<JavaRepeatable>)