[Test] KT-61360: add tests for the IrFakeOverrideBuilder
Add tests for fake overrides with focus on java interoperability Co-authored-by: Aleksandra Arsenteva <aleksandra.arsenteva@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
30aae741a6
commit
82255d5ee8
+36
@@ -0,0 +1,36 @@
|
||||
// FIR_IDENTICAL
|
||||
// TARGET_BACKEND: JVM
|
||||
|
||||
// FILE: Java1.java
|
||||
public class Java1 {
|
||||
public static int a = 2;
|
||||
public static void foo(Object t) { }
|
||||
public static Object bar() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
// FILE: test.kt
|
||||
|
||||
abstract class A : Java1(), KotlinInterface
|
||||
|
||||
class B(override val a: Int) : Java1(), KotlinInterface {
|
||||
override fun foo(t: Int) { }
|
||||
override fun bar(): Int {
|
||||
return 1
|
||||
}
|
||||
}
|
||||
|
||||
interface KotlinInterface {
|
||||
val a : Int
|
||||
fun foo(t: Int)
|
||||
fun bar(): Int
|
||||
}
|
||||
|
||||
fun test(a: A, b: B){
|
||||
a.a
|
||||
a.foo(1)
|
||||
a.bar()
|
||||
b.a
|
||||
b.foo(1)
|
||||
b.bar()
|
||||
}
|
||||
Reference in New Issue
Block a user