mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
Base support of StackValue.Property inlining
This commit is contained in:
24
compiler/testData/codegen/bytecodeText/inline/property/simple.kt
vendored
Normal file
24
compiler/testData/codegen/bytecodeText/inline/property/simple.kt
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
package test
|
||||
|
||||
var value: Int = 0
|
||||
|
||||
inline var z: Int
|
||||
get() = ++value
|
||||
set(p: Int) { value = p }
|
||||
|
||||
fun box(): String {
|
||||
val v = z
|
||||
if (value != 1) return "fail 1: $value"
|
||||
|
||||
z = v + 2
|
||||
|
||||
if (value != 3) return "fail 2: $value"
|
||||
var p = z
|
||||
|
||||
if (value != 4) return "fail 3: $value"
|
||||
|
||||
return "OK1"
|
||||
}
|
||||
|
||||
// 0 SimpleKt.getZ
|
||||
// 0 SimpleKt.setZ
|
||||
Reference in New Issue
Block a user