[JVM IR] Add tests for KT-15971.
This commit is contained in:
committed by
Alexander Udalov
parent
2239b5ceab
commit
79fef09bf5
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM
|
||||
interface Q {
|
||||
fun foo(a: Double): Double
|
||||
}
|
||||
|
||||
interface Z {
|
||||
fun foo(a: Double = 1.0): Double
|
||||
}
|
||||
|
||||
class R : Q, Z {
|
||||
override fun foo(a: Double) = a
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (R().foo() != 1.0) return "fail 1"
|
||||
if (R().foo(2.0) != 2.0) return "fail 2"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM
|
||||
interface Q {
|
||||
fun foo(a: Double) = 0.0
|
||||
}
|
||||
|
||||
interface Z {
|
||||
fun foo(a: Double = 1.0): Double
|
||||
}
|
||||
|
||||
class R : Q, Z {
|
||||
override fun foo(a: Double) = a
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (R().foo() != 1.0) return "fail 1"
|
||||
if (R().foo(2.0) != 2.0) return "fail 2"
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// IGNORE_BACKEND: JVM
|
||||
interface Q {
|
||||
fun foo(a: Double): Double
|
||||
}
|
||||
|
||||
interface Z {
|
||||
fun foo(a: Double = 1.0) = 0.0
|
||||
}
|
||||
|
||||
class R : Q, Z {
|
||||
override fun foo(a: Double) = a
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
if (R().foo() != 1.0) return "fail 1"
|
||||
if (R().foo(2.0) != 2.0) return "fail 2"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user