Add ir interpreter tests
This commit is contained in:
committed by
TeamCityServer
parent
cc2d7340dc
commit
e28ab45c51
@@ -0,0 +1,21 @@
|
||||
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()<!>
|
||||
Reference in New Issue
Block a user