mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
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+.
15 lines
233 B
Kotlin
Vendored
15 lines
233 B
Kotlin
Vendored
// LANGUAGE_VERSION: 1.0
|
|
// 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 |