Drop KPropertyNFromReferenceImpl classes

The only place where their get/set methods were used was in
KPropertyNImpl.Getter.invoke, and it's fine if that results in a reflective
call instead (KPropertyN#getter is not available without kotlin-reflect.jar
anyway). The test data has been changed because a package local Java field is
not accessible via reflection
This commit is contained in:
Alexander Udalov
2016-09-07 12:18:28 +03:00
parent b0af2581ae
commit fc043c6e66
3 changed files with 17 additions and 34 deletions
@@ -2,7 +2,9 @@
// FILE: J.java
public class J {
static String x;
public static String x;
static String packageLocalField;
}
// FILE: K.kt
@@ -19,5 +21,13 @@ fun box(): String {
assertEquals("OK", J.x)
assertEquals("OK", f.getter())
val pl = J::packageLocalField.getter
try {
pl()
return "Fail: package local field must be inaccessible"
} catch (e: Exception) {
// OK
}
return f.get()
}