Files
kotlin-fork/compiler/testData/codegen/boxInline/dontReify/dispatchReceiver.kt
T
vladislav.grechko f318b5969d Erase non-reified type parameters by-default when inlining.
Substitution of type arguments to non-reified type parameters may lead
to accidental reification, which should not be done (see ^KT-60174 for
examples). So, we should erase them, except the few cases.

^KT-60174: Fixed
^KT-60175: Fixed
2024-01-26 18:31:20 +00:00

11 lines
149 B
Kotlin
Vendored

// FILE: 1.kt
inline fun <T> foo(): String {
return bar<T>()!!.toString()
}
fun <T> bar(): T = "OK" as T
// FILE: 2.kt
fun box() = foo<Int>()