Fix constant expression inlining logic

Constant expressions are inlined if they do not depend on non-inlineable
vals.
Java constants are always inlined.
Kotlin constants are inlined in LV 1.1+.
This commit is contained in:
Dmitry Petrov
2017-10-13 15:14:58 +03:00
parent 5acc992956
commit 16b7bece46
7 changed files with 68 additions and 12 deletions

View File

@@ -0,0 +1,15 @@
// LANGUAGE_VERSION: 1.1
// FILE: test.kt
fun test1(a: A) = a.X
fun test2(a: A) = 1 + a.X
fun test3(a: A) = 1 < a.X
// FILE: A.java
public class A {
public final int X = 42;
}
// @TestKt.class:
// 0 42
// 0 43
// 3 GETFIELD A.X