Files
kotlin-fork/compiler/testData/codegen/box/inlineClasses/callComputablePropertyInsideInlineClass.kt
T
2021-12-15 17:14:22 +00:00

20 lines
361 B
Kotlin
Vendored

// WITH_STDLIB
// WORKS_WHEN_VALUE_CLASS
// LANGUAGE: +ValueClasses
OPTIONAL_JVM_INLINE_ANNOTATION
value class Props(val intArray: IntArray) {
val size get() = intArray.size
fun foo(): Int {
val a = size
return a
}
}
fun box(): String {
val f = Props(intArrayOf(1, 2, 3))
if (f.foo() != 3) return "fail"
return "OK"
}