Support reflection tests on Android

This commit is contained in:
Mikhael Bogdanov
2019-01-22 17:48:45 +01:00
parent 91980c5293
commit f2a51d3b80
49 changed files with 235 additions and 174 deletions
@@ -3,6 +3,8 @@
// WITH_REFLECT
//test for KT-3722 Write correct generic type information for generated fields
package test
import kotlin.properties.Delegates
class Z<T> {
@@ -50,25 +52,25 @@ fun box(): String {
val classField = clz.getDeclaredField("classField1");
if (classField.getGenericType().toString() != "Z<T>")
if (classField.getGenericType().toString() != "test.Z<T>")
return "fail1: " + classField.getGenericType();
val classField2 = clz.getDeclaredField("classField2");
if (classField2.getGenericType().toString() != "Z<java.lang.String>")
if (classField2.getGenericType().toString() != "test.Z<java.lang.String>")
return "fail2: " + classField2.getGenericType();
val classField3 = clz.getDeclaredField("classField3");
if (classField3.getGenericType().toString() != "Zout<java.lang.String>")
if (classField3.getGenericType().toString() != "test.Zout<java.lang.String>")
return "fail3: " + classField3.getGenericType();
val classField4 = clz.getDeclaredField("classField4");
if (classField4.getGenericType().toString() != "Zin<TParam>")
if (classField4.getGenericType().toString() != "test.Zin<test.TParam>")
return "fail4: " + classField4.getGenericType();
val classField5 = clz.getDeclaredField("delegateLazy\$delegate");