Files
kotlin-fork/compiler/testData/ir/interpreter/overrideExtension.kt
T
2022-03-30 08:35:21 +00:00

15 lines
340 B
Kotlin
Vendored

@CompileTimeCalculation
open class A {
open fun String.getSize() = this.length
fun returnSizeOf(str: String) = str.getSize()
}
@CompileTimeCalculation
class B : A() {
override fun String.getSize() = -1
}
const val a = <!EVALUATED: `4`!>A().returnSizeOf("1234")<!>
const val b = <!EVALUATED: `-1`!>B().returnSizeOf("1234")<!>