Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/syntheticPropClashingWithJvmField.kt
T
Kirill Rakhman 7f8dc56d36 [FIR2IR] Don't generate fake overrides for clashing synthetic properties
If a synthetic prop clashes with a real property (e.g. @JvmField
property from parent Kotlin class), don't generate fake override for the
synthetic property. This fixes a CONFLICTING_INHERITED_JVM_DECLARATIONS
error in a mixed hierarchy.

^KT-56538 Fixed
2023-02-15 10:10:31 +00:00

34 lines
702 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// WITH_STDLIB
// ISSUE: KT-56538
// FILE: SerializableScheme.java
public interface SerializableScheme {
String getSchemeState();
}
// FILE: NewInspectionProfile.kt
abstract class NewInspectionProfile : SerializableScheme {
@JvmField
internal var schemeState: String? = "OK"
override fun getSchemeState(): String? = schemeState
}
// FILE: InspectionProfileImpl.java
public class InspectionProfileImpl extends NewInspectionProfile {
}
// FILE: InspectionProfileModifiableModel.kt
class InspectionProfileModifiableModel : InspectionProfileImpl()
// FILE: test.kt
fun box(): String {
return InspectionProfileModifiableModel().schemeState.toString()
}