Skip to content

@SerialInfo Accidental override: The following declarations have the same JVM signature #1672

@Mazel-Tovr

Description

@Mazel-Tovr

Describe the bug
When we mark annotation class with @SerialInfo annotation and this class have a filed with KClass<*> type then we get such error Accidental override: The following declarations have the same JVM signature
To Reproduce

@SerialInfo
@Target(AnnotationTarget.PROPERTY)
annotation class TestAnnotation(
    val clazz: KClass<*>,
)

Got an error

Accidental override: The following declarations have the same JVM signature (clazz()Lkotlin/reflect/KClass;):
    fun <get-clazz>(): KClass<*> defined in com.epam.kodux.TestAnnotation.Impl
    fun clazz(): KClass<*> defined in com.epam.kodux.TestAnnotation.Impl

overriding getter name by using @get:JvmName("newName") doesn't help

Expected behavior
This code compiling like in Kotlin 1.4.21 and serialization 1.0.1

Environment

  • Kotlin version: 1.5.30
  • Library version: 1.2.2 or 1.3.0-RC
  • Kotlin platforms: JVM
  • Gradle version: 6.5.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions