Test for obsolete KT-5445: Bad access to protected data in getfield

#KT-5445 Obsolete
This commit is contained in:
Michael Bogdanov
2015-12-15 13:58:35 +03:00
parent 179498d971
commit b0a7706812
5 changed files with 51 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
package test2
import test.A
public fun box(): String {
return B().test(B())
}
public class B : A() {
public fun test(other:Any): String {
if (other is B && other.s == 2) {
return "OK"
}
return "fail"
}
}
+5
View File
@@ -0,0 +1,5 @@
package test
open class A {
@JvmField protected val s = 2;
}
+13
View File
@@ -0,0 +1,13 @@
package test2
import test.A
class C : A() {
fun a(): String {
return this.s
}
}
public fun box(): String {
return C().a()
}
+5
View File
@@ -0,0 +1,5 @@
package test
open class A {
@JvmField protected val s = "OK";
}