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
+19
View File
@@ -0,0 +1,19 @@
@CompileTimeCalculation
fun Int.get(): Int {
return this
}
@CompileTimeCalculation
class A(val length: Int) {
fun String.hasRightLength(): Boolean {
return this@hasRightLength.length == this@A.length
}
fun check(string: String): Boolean {
return string.hasRightLength()
}
}
const val simple = 1.<!EVALUATED: `1`!>get()<!>
const val right = A(3).<!EVALUATED: `true`!>check("123")<!>
const val wrong = A(2).<!EVALUATED: `false`!>check("123")<!>