Inline refactoring: shouldn't lose return type information
#KT-26705 Fixed
This commit is contained in:
+9
@@ -0,0 +1,9 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
buildMyList<caret>(5)
|
||||
}
|
||||
|
||||
private fun buildMyList(count: Int): List<String> {
|
||||
return buildList(size = count)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
buildList<String>(size = 5)
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
buildMyList<caret>(5)
|
||||
}
|
||||
|
||||
private fun buildMyList(count: Int): List<String> {
|
||||
buildList(size = count)
|
||||
return buildList(size = count)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
buildList(size = 5)
|
||||
buildList<String>(size = 5)
|
||||
}
|
||||
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
buildMyList<caret>(5)
|
||||
}
|
||||
|
||||
private fun buildMyList(count: Int): List<String> {
|
||||
val b: List<Int> = buildList(size = count)
|
||||
return buildList(size = count)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
fun f() {
|
||||
val b: List<Int> = buildList(size = 5)
|
||||
buildList<String>(size = 5)
|
||||
}
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
fun <T> buildType(size: Int): T = TODO()
|
||||
|
||||
fun f() {
|
||||
buildMyList<caret>(5)
|
||||
}
|
||||
|
||||
private fun buildMyList(count: Int) {
|
||||
return buildType(size = count)
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
fun <T> buildType(size: Int): T = TODO()
|
||||
|
||||
fun f() {
|
||||
buildType<Unit>(size = 5)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
class Test {
|
||||
fun f() {
|
||||
val list = buildMyList(5)
|
||||
}
|
||||
|
||||
private fun buildMyList<caret>(count: Int): List<String> {
|
||||
return buildList(size = count)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
fun <T> buildList(size: Int) = listOf<T>()
|
||||
|
||||
class Test {
|
||||
fun f() {
|
||||
val list = buildList<String>(size = 5)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user