Files
kotlin-fork/compiler/testData/ir/interpreter/overrideExtension.kt
T
2021-06-07 15:35:12 +03: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 = A().<!EVALUATED: `4`!>returnSizeOf("1234")<!>
const val b = B().<!EVALUATED: `-1`!>returnSizeOf("1234")<!>