Fix for KT-4250: IllegalAccessError when using protected java member from lambda function

#KT-4250 Fixed
This commit is contained in:
Michael Bogdanov
2015-10-27 10:33:28 +03:00
parent 0a70c80af3
commit f3e6fab68e
10 changed files with 149 additions and 10 deletions
@@ -0,0 +1,7 @@
public abstract class First {
protected static String TEST = "OK";
protected static String test() {
return TEST;
}
}
@@ -0,0 +1,23 @@
package anotherPackage
import First
class Second : First() {
val some = { First.TEST }
fun foo() = { First.test() }
val some2 = { TEST }
fun foo2() = { test() }
}
fun box(): String {
if (Second().some.invoke() != "OK") return "fail 1"
if (Second().foo().invoke() != "OK") return "fail 2"
if (Second().some2.invoke() != "OK") return "fail 3"
if (Second().foo2().invoke() != "OK") return "fail 4"
return "OK"
}