Add ir interpreter tests

This commit is contained in:
Ivan Kylchik
2021-05-19 16:27:03 +03:00
committed by TeamCityServer
parent cc2d7340dc
commit e28ab45c51
115 changed files with 5104 additions and 0 deletions
+21
View File
@@ -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()<!>