Inline refactoring: should add explicit type argument for parameters

#KT-17402 Fixed
This commit is contained in:
Dmitry Gridin
2020-06-26 10:11:50 +07:00
parent 45234c9784
commit c3b726f10a
14 changed files with 111 additions and 11 deletions
@@ -0,0 +1,8 @@
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun downReturn<caret>(): GeneOut<SomeFace> = downUnder()
fun callDown() {
val v1 = downReturn()
}
@@ -0,0 +1,7 @@
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun callDown() {
val v1 = downUnder<SomeFace>()
}
@@ -5,6 +5,5 @@ fun <T> downUnder(): GeneOut<T> = Empty
fun downParameter(p: GeneOut<SomeFace>) = p
fun callDown() {
// BUG: KT-17402
val v2 = <caret>downParameter(downUnder())
}
@@ -4,6 +4,5 @@ object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun callDown() {
// BUG: KT-17402
val v2 = downUnder()
val v2 = downUnder<SomeFace>()
}
@@ -0,0 +1,13 @@
package test.pack.one
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun downParameter<caret>(p: GeneOut<SomeFace>): GeneOut<SomeFace> {
p
return p
}
fun callDown() {
val v2 = downParameter(downUnder())
}
@@ -0,0 +1,11 @@
package test.pack.one
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun callDown() {
val p = downUnder<SomeFace>()
p
val v2 = p
}
@@ -0,0 +1,7 @@
package test.pack.one
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
fun downParameter(p: GeneOut<SomeFace>): GeneOut<SomeFace> = p
@@ -0,0 +1,6 @@
package test.pack.one
interface SomeFace
interface GeneOut<out T> {}
object Empty : GeneOut<Nothing>
fun <T> downUnder(): GeneOut<T> = Empty
@@ -0,0 +1,8 @@
package adadawwq32q
import test.pack.one.downParameter
import test.pack.one.downUnder
fun callDown() {
val result = downParameter<caret>(downUnder())
}
@@ -0,0 +1,8 @@
package adadawwq32q
import test.pack.one.SomeFace
import test.pack.one.downUnder
fun callDown() {
val result = downUnder<SomeFace>()
}
@@ -3,4 +3,4 @@ fun g() {
if (it.isEmpty()) return@any false
it.length < 10
})
}
}