Files
kotlin-fork/compiler/testData/codegen/box/javaInterop/syntheticPropClashingWithJvmField.kt
T
Alexander Udalov 39fda3535a IR: fix internal visibility check in override builder
In case there are Java sources in the module, K2 creates two instances
of `FirModuleDescriptor` with the same name: one for Kotlin sources, one
for Java sources. When building fake overrides in IR, it's important to
understand that those are the same module. Currently it's done by
comparing the names, but in the future it may be improved in KT-62534.

The changed test was in fact unrelated to KT-61805, and the problem
there was rather that no fake override was created for internal property
`schemeState` in `InspectionProfileModifiableModel`.
2023-11-14 09:45:06 +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()
}