Test for obsolete KT-6020: Type inference failed on property reference of generic class
#KT-6020 Can't Reproduce
This commit is contained in:
@@ -0,0 +1,20 @@
|
|||||||
|
//For KT-6020
|
||||||
|
import kotlin.reflect.KMemberProperty
|
||||||
|
import kotlin.reflect.KMutableMemberProperty
|
||||||
|
|
||||||
|
class Value<T>(var value: T = null as T, var text: String? = null)
|
||||||
|
|
||||||
|
val <T> Value<T>.additionalText by DVal(Value<T>::text) //works
|
||||||
|
|
||||||
|
val <T> Value<T>.additionalValue by DVal(Value<T>::value) //not work
|
||||||
|
|
||||||
|
class DVal<T, R, P: KMemberProperty<T, R>>(val kmember: P) {
|
||||||
|
fun get(t: T, p: PropertyMetadata): R {
|
||||||
|
return kmember.get(t)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val p = Value("O", "K")
|
||||||
|
return p.additionalValue + p.additionalText
|
||||||
|
}
|
||||||
+6
@@ -634,6 +634,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
|
|||||||
doTestWithStdlib(fileName);
|
doTestWithStdlib(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("genericProperty.kt")
|
||||||
|
public void testGenericProperty() throws Exception {
|
||||||
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/callableReference/property/genericProperty.kt");
|
||||||
|
doTestWithStdlib(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("javaBeanConvention.kt")
|
@TestMetadata("javaBeanConvention.kt")
|
||||||
public void testJavaBeanConvention() throws Exception {
|
public void testJavaBeanConvention() throws Exception {
|
||||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/callableReference/property/javaBeanConvention.kt");
|
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/callableReference/property/javaBeanConvention.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user