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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user