Fix for KT-10590: IllegalAccessError when protected getter of Java base class is accessed from lambda using property access syntax

This commit is contained in:
Michael Bogdanov
2016-01-25 13:02:42 +03:00
parent 9d66852ae2
commit cf09949354
6 changed files with 86 additions and 2 deletions

View File

@@ -0,0 +1,12 @@
public class JavaBaseClass {
private String field = "fail";
protected String getFoo() {
return field;
}
protected void setFoo(String foo) {
field = foo;
}
}

View File

@@ -0,0 +1,19 @@
package z
import JavaBaseClass
object KotlinExtender : JavaBaseClass() {
@JvmStatic fun test(): String {
return runSlowly {
foo = "OK"
foo
}
}
}
fun runSlowly(f: () -> String): String {
return f()
}
fun box(): String {
return KotlinExtender.test()
}