Test for obsolete KT-5445: Bad access to protected data in getfield
#KT-5445 Obsolete
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
open class A {
|
||||
@JvmField protected val s = 2;
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package test
|
||||
|
||||
open class A {
|
||||
@JvmField protected val s = "OK";
|
||||
}
|
||||
+12
@@ -95,6 +95,18 @@ public class BlackBoxMultiFileCodegenTestGenerated extends AbstractBlackBoxCodeg
|
||||
doTestMultiFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt5445")
|
||||
public void testKt5445() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxMultiFile/kt5445/");
|
||||
doTestMultiFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt5445_2")
|
||||
public void testKt5445_2() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxMultiFile/kt5445_2/");
|
||||
doTestMultiFile(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("kt9717")
|
||||
public void testKt9717() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/boxMultiFile/kt9717/");
|
||||
|
||||
Reference in New Issue
Block a user