Change to star projection: do not suggest in arguments or receiver

#KT-23259 Fixed
This commit is contained in:
Toshiaki Kameyama
2019-02-13 16:54:00 +09:00
committed by Dmitry Gridin
parent 73396b5018
commit 4e3d13fcee
19 changed files with 196 additions and 2 deletions
@@ -0,0 +1,8 @@
// "Change type arguments to <*>" "false"
// ACTION: Convert to run
// ACTION: Convert to with
fun test(a: Any) {
(a as List<Boolean><caret>).bar()
}
fun List<Boolean>.bar() {}
@@ -0,0 +1,8 @@
// "Change type arguments to <*, *>" "false"
// ACTION: Convert to run
// ACTION: Convert to with
fun test(a: Any) {
(a as Map<Int, Boolean><caret>).bar()
}
fun Map<Int, Boolean>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
(a as List<Boolean><caret>).bar()
}
fun List<*>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
(a as List<*>).bar()
}
fun List<*>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
(a as List<Boolean><caret>).bar()
}
fun <T> List<T>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
(a as List<*>).bar()
}
fun <T> List<T>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*, *>" "true"
fun test(a: Any) {
(a as Map<Int, Boolean><caret>).bar()
}
fun <T> Map<T, *>.bar() {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*, *>" "true"
fun test(a: Any) {
(a as Map<*, *>).bar()
}
fun <T> Map<T, *>.bar() {}
@@ -0,0 +1,7 @@
// "Change type arguments to <*>" "false"
// ACTION: Add 'list =' to argument
fun test(a: Any) {
foo(a as List<Boolean><caret>)
}
fun foo(list: List<Boolean>) {}
@@ -0,0 +1,7 @@
// "Change type arguments to <*, *>" "false"
// ACTION: Add 'map =' to argument
fun test(a: Any) {
foo(a as Map<Int, Boolean><caret>)
}
fun foo(map: Map<Int, Boolean>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
foo(a as List<Boolean><caret>)
}
fun foo(list: List<*>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
foo(a as List<*>)
}
fun foo(list: List<*>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
foo(a as List<Boolean><caret>)
}
fun <T> foo(list: List<T>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*>" "true"
fun test(a: Any) {
foo(a as List<*>)
}
fun <T> foo(list: List<T>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*, *>" "true"
fun test(a: Any) {
foo(a as Map<Int, Boolean><caret>)
}
fun <T> foo(map: Map<T, *>) {}
@@ -0,0 +1,6 @@
// "Change type arguments to <*, *>" "true"
fun test(a: Any) {
foo(a as Map<*, *>)
}
fun <T> foo(map: Map<T, *>) {}
@@ -0,0 +1,7 @@
// "Change type arguments to <*>" "false"
// ACTION: Add 'list =' to argument
fun test(a: Any) {
foo(a as? List<Boolean><caret>)
}
fun foo(list: List<Boolean>?) {}