Files
kotlin-fork/js/js.translator/testData/box/examples/funDelegation.kt
T
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00

21 lines
404 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1127
open class Base() {
fun n(n: Int): Int = n + 1
}
interface Abstract {
}
class Derived1() : Base(), Abstract {
}
class Derived2() : Abstract, Base() {
}
fun test(s: Base): Boolean = s.n(238) == 239
fun box(): String {
if (!test(Base())) return "Fail #1"
if (!test(Derived1())) return "Fail #2"
if (!test(Derived2())) return "Fail #3"
return "OK"
}