Files
kotlin-fork/compiler/testData/ir/interpreter/proxy/superWrapper.kt
T
2021-06-07 15:35:12 +03:00

22 lines
484 B
Kotlin
Vendored

import kotlin.collections.*
@CompileTimeCalculation
class MyArrayList<E>: ArrayList<E>() {
var addCounter = 0
override fun add(element: E): Boolean {
addCounter++
return super.add(element)
}
}
@CompileTimeCalculation
fun test(): String {
val list = MyArrayList<Int>()
list.add(1)
list.add(2)
list.add(3)
return "Counter " + list.addCounter + "; size " + list.size
}
const val testResult = <!EVALUATED: `Counter 3; size 3`!>test()<!>