[IR] Rewrite how interpreter works with the Unit result
This way interpreter works in more correct way. Every expression produces some result, and if we don't need it, the interpreter will discard it.
This commit is contained in:
+1
-4
@@ -1,9 +1,7 @@
|
||||
@CompileTimeCalculation
|
||||
class A {
|
||||
const val a = <!EVALUATED: `10`!>{ 10 }()<!> // lambda is needed to avoid computions by old frontend
|
||||
|
||||
companion object {
|
||||
const val static = <!EVALUATED: `-10`!>{ -10 }()<!>
|
||||
const val static = <!EVALUATED: `-10`!>{ -10 }()<!> // lambda is needed to avoid computions by old frontend
|
||||
|
||||
fun getStaticNumber(): Int {
|
||||
return Int.MAX_VALUE
|
||||
@@ -21,7 +19,6 @@ object ObjectWithConst {
|
||||
fun concat(first: String, second: Any) = "$first$second"
|
||||
}
|
||||
|
||||
const val num = <!EVALUATED: `10`!>A().a<!>
|
||||
const val numStatic = <!EVALUATED: `-10`!>A.static<!>
|
||||
const val numStaticFromFun = <!EVALUATED: `2147483647`!>A.getStaticNumber()<!>
|
||||
const val valFromObject = <!EVALUATED: `Value in a: 100`!>ObjectWithConst.b<!>
|
||||
|
||||
Reference in New Issue
Block a user