K2: reproduce KT-58618

This commit is contained in:
Mikhail Glukhikh
2023-05-23 13:55:18 +02:00
committed by Space Team
parent 666239c587
commit 2cfa3d7e0d
8 changed files with 83 additions and 0 deletions
@@ -0,0 +1,14 @@
// FIR_DUMP
// WITH_REFLECT
import kotlin.reflect.KProperty
// Definitions
class State<T>(var value: T)
<!NOTHING_TO_INLINE!>inline<!> operator fun <T> State<T>.getValue(thisRef: Any?, property: KProperty<*>): T = value
inline fun <T> remember(block: () -> T): T = block()
// list should have a type of List<Int>, not Any?
val list by remember { State(listOf(0)) }
val first = list.first()