K1/K2: add tests confirming behavior of remaining KT-63242 cases
This commit is contained in:
committed by
Space Team
parent
0008e832d8
commit
e8ba534904
@@ -0,0 +1,32 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K2: JVM_IR
|
||||
// Reason: incorrect result FAIL B
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// ISSUE: KT-63242, KT-66324
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
private open class C : B() {
|
||||
override fun foo(d: Any?): String = "FAIL C"
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
D().foo("s")
|
||||
|
||||
// FILE: A.java
|
||||
interface A {
|
||||
String foo(Object value);
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
public String foo(String value) {
|
||||
return "FAIL B";
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
@Override
|
||||
public String foo(Object value) {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// TARGET_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND_K1: JVM_IR
|
||||
// Reason: red code
|
||||
// ISSUE: KT-63242, KT-66324
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
private open class C : B() {
|
||||
override fun foo(d: Any?): String = "FAIL"
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
D().foo("s")
|
||||
|
||||
// FILE: A.java
|
||||
interface A {
|
||||
String foo(Object value);
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
public String foo(String value) {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
D:
|
||||
[Enhancement]: public open fun foo(value: R|@EnhancedNullability kotlin/Any?|): R|@EnhancedNullability kotlin/String| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| from Use site scope of /C [id: 1]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /B [id: 2]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /A [id: 2]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /D [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Use site scope of /C [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /B [id: 0]
|
||||
@@ -0,0 +1,14 @@
|
||||
FILE: box.kt
|
||||
private open class C : R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| {
|
||||
^foo String(C)
|
||||
}
|
||||
|
||||
}
|
||||
public final fun box(): R|kotlin/String| {
|
||||
^box R|/D.D|().R|/B.foo|(String(s))
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
// FIR_IDENTICAL
|
||||
// ISSUE: KT-63242, KT-66324
|
||||
// SCOPE_DUMP: D:foo
|
||||
// FIR_DUMP
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
private open class C : B() {
|
||||
override fun foo(d: Any?): String = "C"
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
D().foo("s") // K1: D.foo, K2: B.foo
|
||||
|
||||
// FILE: A.java
|
||||
interface A {
|
||||
String foo(Object value);
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
public String foo(String value) {
|
||||
return "B";
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
@Override
|
||||
public String foo(Object value) {
|
||||
return "D";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
D:
|
||||
[Enhancement]: public open fun foo(value: R|@EnhancedNullability kotlin/Any?|): R|@EnhancedNullability kotlin/String| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| from Use site scope of /C [id: 1]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /B [id: 2]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /A [id: 2]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /D [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Use site scope of /C [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /B [id: 0]
|
||||
@@ -0,0 +1,26 @@
|
||||
// ISSUE: KT-63242, KT-66324
|
||||
// SCOPE_DUMP: D:foo
|
||||
// FIR_DUMP
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
private open class C : B() {
|
||||
override fun foo(d: Any?): String = "C"
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
D().foo("s")
|
||||
|
||||
// FILE: A.java
|
||||
interface A {
|
||||
String foo(Object value);
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
public String foo(String value) {
|
||||
return "B";
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
D:
|
||||
[Source]: public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| from Java enhancement scope for /D [id: 0]
|
||||
[Source]: public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| from Use site scope of /C [id: 0]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /B [id: 1]
|
||||
[Enhancement]: public abstract fun foo(value: R|kotlin/Any!|): R|kotlin/String!| from Java enhancement scope for /A [id: 1]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /D [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Use site scope of /C [id: 0]
|
||||
[Enhancement]: public open fun foo(value: R|kotlin/String!|): R|kotlin/String!| from Java enhancement scope for /B [id: 0]
|
||||
@@ -0,0 +1,14 @@
|
||||
FILE: box.kt
|
||||
private open class C : R|B| {
|
||||
public constructor(): R|C| {
|
||||
super<R|B|>()
|
||||
}
|
||||
|
||||
public open override fun foo(d: R|kotlin/Any?|): R|kotlin/String| {
|
||||
^foo String(C)
|
||||
}
|
||||
|
||||
}
|
||||
public final fun box(): R|kotlin/String| {
|
||||
^box R|/D.D|().R|/B.foo|(String(s))
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// ISSUE: KT-63242, KT-66324
|
||||
// SCOPE_DUMP: D:foo
|
||||
// FIR_DUMP
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
private open class C : B() {
|
||||
override fun foo(d: Any?): String = "C"
|
||||
}
|
||||
|
||||
fun box(): String =
|
||||
D().<!INVISIBLE_MEMBER!>foo<!>("s")
|
||||
|
||||
// FILE: A.java
|
||||
interface A {
|
||||
String foo(Object value);
|
||||
}
|
||||
|
||||
abstract class B implements A {
|
||||
public String foo(String value) {
|
||||
return "B";
|
||||
}
|
||||
}
|
||||
|
||||
class D extends C {
|
||||
}
|
||||
Reference in New Issue
Block a user