@CompileTimeCalculation class A { companion object { const val static = { -10 }() // lambda is needed to avoid computions by old frontend fun getStaticNumber(): Int { return Int.MAX_VALUE } } } @CompileTimeCalculation object ObjectWithConst { const val a = 100 const val b = concat("Value in a: ", a) val nonConst = { "Not const field in compile time object" }() fun concat(first: String, second: Any) = "$first$second" } const val numStatic = A.static const val numStaticFromFun = A.getStaticNumber() const val valFromObject = ObjectWithConst.b const val valFnonConstFromObject = ObjectWithConst.nonConst