// ISSUE: KT-58013 // WITH_STDLIB // WITH_REFLECT // FIR_DUMP // IGNORE_BACKEND_K1: ANY import kotlin.reflect.KProperty data class Ref(val t: D) class GenericDelegate(val value: G) operator fun Ref.provideDelegate(a: Any?, p: KProperty<*>): GenericDelegate = GenericDelegate(this.t) operator fun GenericDelegate.getValue(a: Any?, p: KProperty<*>): W = this.value fun List>.getElement(i: Int): Ref = this[i] as Ref @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") fun test(list: List>) { val data: String by list.getElement(0)!! require(data == list[0].t) val data2: String by list.getElement(0) require(data2 == list[0].t) } fun box(): String { test(listOf(Ref("q"))) return "OK" }