Add tests for super calls in inline classes
This commit is contained in:
committed by
Alexander Udalov
parent
0fe8fec1d1
commit
b173284d1d
@@ -0,0 +1,12 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM
|
||||
|
||||
inline class A(val x: Int) {
|
||||
fun f(): Int = super.hashCode()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A(1).f()
|
||||
return "OK"
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
|
||||
interface A {
|
||||
fun f(x: String) = x
|
||||
}
|
||||
|
||||
inline class B(val y: String) : A {
|
||||
override fun f(x: String) = super.f(x + y)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
return B("K").f("O")
|
||||
}
|
||||
Reference in New Issue
Block a user