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
+27
View File
@@ -0,0 +1,27 @@
@CompileTimeCalculation
interface Object {
fun get(): String
@CompileTimeCalculation
fun defaultGet() = "Object"
}
object A : Object {
@CompileTimeCalculation
override fun get() = "A"
}
open class B : Object {
@CompileTimeCalculation
override fun get() = "B"
}
object C : B() {
@CompileTimeCalculation
override fun get() = "Default: " + super.defaultGet() + "; from super B: " + super.get() + "; from current: " + "companion C"
}
const val a1 = A.<!EVALUATED: `Object`!>defaultGet()<!>
const val a2 = A.<!EVALUATED: `A`!>get()<!>
const val c1 = C.<!EVALUATED: `Object`!>defaultGet()<!>
const val c2 = C.<!EVALUATED: `Default: Object; from super B: B; from current: companion C`!>get()<!>