Add different black box tests around KT-52338

This commit is contained in:
Mikhail Glukhikh
2023-01-30 13:34:09 +01:00
committed by Space Team
parent f6bd4d5e15
commit bf090cdc6d
27 changed files with 1064 additions and 8 deletions
@@ -6,6 +6,10 @@
// FILE: Base.java
public class Base {
protected String TAG = "OK";
public String foo() {
return TAG;
}
}
// FILE: Sub.kt
@@ -16,6 +20,18 @@ class Sub : Base() {
}
fun log() = TAG
fun logReference() = this::TAG.get()
fun logAssignment(): String {
TAG = "12"
if (foo() != "12") return "Error writing: ${foo()}"
return "OK"
}
}
fun box() = Sub().log()
fun box(): String {
if (Sub().log() != "OK") return Sub().log()
if (Sub().logReference() != "OK") return Sub().logReference()
return Sub().logAssignment()
}