Files
kotlin-fork/backend.native/tests/external/codegen/blackbox/classes/implementComparableInSubclass.kt
T
Ilya Matveev 1b553ebfaf backend/tests: Add blackbox tests from Kotlin JVM
Added tests from testData/codegen/box directory. There are blackbox tests
in other directories and they are to be added.
2017-01-20 14:04:04 +03:00

22 lines
397 B
Kotlin

// See KT-12865
package foo
abstract class Base {
val x = 23
}
class Derived : Base(), Comparable<Derived> {
val y = 42
override fun compareTo(other: Derived): Int {
throw UnsupportedOperationException("not implemented")
}
}
fun box(): String {
val b = Derived()
if (b.x != 23) return "fail1: ${b.x}"
if (b.y != 42) return "fail2: ${b.y}"
return "OK"
}