Aligh test data with JDK 15 reflection output

This commit is contained in:
Mikhael Bogdanov
2021-02-05 14:12:38 +01:00
parent 21e9f67322
commit 3dff225b98
6 changed files with 18 additions and 13 deletions
@@ -19,10 +19,12 @@ interface A<T, Y : B<T>> {
fun box(): String {
val defaultImpls = Class.forName("test.A\$DefaultImpls")
val declaredMethod = defaultImpls.getDeclaredMethod("p", A::class.java, Any::class.java)
if (declaredMethod.toGenericString() != "public static <T_I1,Y,T,L> T test.A\$DefaultImpls.p(test.A<T_I1, Y>,T)") return "fail 1: ${declaredMethod.toGenericString()}"
if (declaredMethod.toGenericString() != "public static <T_I1,Y,T,L> T test.A\$DefaultImpls.p(test.A<T_I1, Y>,T)" &&
declaredMethod.toGenericString() != "public static <T_I1,Y extends test.B<T_I1>,T,L> T test.A\$DefaultImpls.p(test.A<T_I1, Y>,T)") return "fail 1: ${declaredMethod.toGenericString()}"
val declaredProperty = defaultImpls.getDeclaredMethod("getZ", A::class.java, Any::class.java)
if (declaredProperty.toGenericString() != "public static <T_I1,Y,T> T test.A\$DefaultImpls.getZ(test.A<T_I1, Y>,T)") return "fail 2: ${declaredProperty.toGenericString()}"
if (declaredProperty.toGenericString() != "public static <T_I1,Y,T> T test.A\$DefaultImpls.getZ(test.A<T_I1, Y>,T)" &&
declaredProperty.toGenericString() != "public static <T_I1,Y extends test.B<T_I1>,T> T test.A\$DefaultImpls.getZ(test.A<T_I1, Y>,T)") return "fail 2: ${declaredProperty.toGenericString()}"
return "OK"
}