FE: don't approximate type variable based types for public/local declarations

#KT-58618 Fixed
This commit is contained in:
Mikhail Glukhikh
2023-05-23 14:43:41 +02:00
committed by Space Team
parent 2cfa3d7e0d
commit 6e58ba8f33
5 changed files with 41 additions and 34 deletions
@@ -1,12 +1,13 @@
// FIR_IDENTICAL
// 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()
class State<S>(var value: S)
<!NOTHING_TO_INLINE!>inline<!> operator fun <V> State<V>.getValue(thisRef: Any?, property: KProperty<*>): V = value
inline fun <M> remember(block: () -> M): M = block()
// list should have a type of List<Int>, not Any?
val list by remember { State(listOf(0)) }