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
This commit is contained in:
committed by
Space Team
parent
29ecc4d987
commit
f318b5969d
@@ -0,0 +1,13 @@
|
||||
// FILE: 1.kt
|
||||
|
||||
inline fun <T> foo(): String {
|
||||
var arr: Array<T> = Array(1) { Any() } as Array<T>
|
||||
arr[0] = bar()
|
||||
return arr[0] as String
|
||||
}
|
||||
|
||||
fun <T> bar(): T = "OK" as T
|
||||
|
||||
// FILE: 2.kt
|
||||
|
||||
fun box() = foo<Int>()
|
||||
Reference in New Issue
Block a user