Files
kotlin-fork/compiler/testData/codegen/box/syntheticExtensions/kt56072.kt
T
Nikita Bobko 5a96754aec Shift ReferencesToSyntheticJavaProperties feature release from 1.9 to 2.1
Other related tests:
- testGenericJavaProperty
- testFunInterfaceConstructorReference

Meta issue: KT-8575
Review: https://jetbrains.team/p/kt/reviews/9595

UnsupportedSyntheticCallableReferenceChecker only existed for K1,
because we wanted to release the feature for 1.9 and the feature should
have been working for K2 unconditionally. But since, we're postponing
the release until 2.1, we also need to port the checker from K1 to K2
2023-04-17 17:42:01 +00:00

34 lines
701 B
Kotlin
Vendored

// TARGET_BACKEND: JVM
// !LANGUAGE: +ReferencesToSyntheticJavaProperties
// FILE: SuperClass.java
public class SuperClass {
private String stringParam;
public SuperClass(String stringParam)
{
this.stringParam = stringParam;
}
public String getStringParam()
{
return stringParam;
}
}
// FILE: InheritedClass.java
public class InheritedClass extends SuperClass {
public InheritedClass(String stringParam) {
super(stringParam);
}
}
// FILE: test.kt
fun box(): String {
val superValue = (SuperClass::stringParam)(SuperClass("O"))
val inheritedValue = (InheritedClass("K")::stringParam)()
return superValue + inheritedValue
}