Extract refactoring: Make an extracted function 'inline' if any of its type parameters are reified (#KT-23983)

This commit is contained in:
Yan Zhulanow
2018-04-24 19:33:01 +03:00
parent 90bffbf4c8
commit e958a9771f
6 changed files with 52 additions and 2 deletions
@@ -0,0 +1,3 @@
inline fun <reified T> foo() {
<selection>T::class</selection>
}
@@ -0,0 +1,7 @@
inline fun <reified T> foo() {
__dummyTestFun__<T>()
}
inline fun <reified T> __dummyTestFun__() {
T::class
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
inline fun <reified T : CharSequence, reified U, X> foo() {
<selection>listOf(T::class, U::class)</selection>
}
@@ -0,0 +1,9 @@
// WITH_RUNTIME
inline fun <reified T : CharSequence, reified U, X> foo() {
__dummyTestFun__<T, U>()
}
inline fun <reified T : CharSequence, reified U> __dummyTestFun__() {
listOf(T::class, U::class)
}