mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +00:00
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:
15
compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv11.kt
vendored
Normal file
15
compiler/testData/codegen/bytecodeText/constants/noInlineNonStaticJavaField_lv11.kt
vendored
Normal 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
|
||||
Reference in New Issue
Block a user