"Remove redundant receiver" quick fix: Remove unused type parameter #KT-23512

This commit is contained in:
Toshiaki Kameyama
2018-09-05 13:18:59 +09:00
committed by Mikhail Glukhikh
parent 0cd25353bc
commit 90529dfda4
19 changed files with 183 additions and 27 deletions
@@ -0,0 +1,5 @@
fun <T> <caret>T.foo() {}
fun test() {
"".foo()
}
@@ -0,0 +1,5 @@
fun foo() {}
fun test() {
foo()
}
@@ -0,0 +1,5 @@
fun <T> <caret>T.foo(t: T) {}
fun test() {
"".foo("")
}
@@ -0,0 +1,5 @@
fun <T> foo(t: T) {}
fun test() {
foo("")
}
@@ -0,0 +1,7 @@
interface TypeHolder<T, U>
fun <T, U> <caret>TypeHolder<T, U>.foo() {}
fun test(holder: TypeHolder<String, Int>) {
holder.foo()
}
@@ -0,0 +1,7 @@
interface TypeHolder<T, U>
fun foo() {}
fun test(holder: TypeHolder<String, Int>) {
foo()
}
@@ -0,0 +1,7 @@
class Test<T> {
fun <caret>T.foo() {}
fun test(t: T) {
t.foo()
}
}
@@ -0,0 +1,7 @@
class Test<T> {
fun foo() {}
fun test(t: T) {
foo()
}
}
@@ -0,0 +1,7 @@
class Test<T> {
fun <U> <caret>U.foo() {}
fun test() {
"".foo()
}
}
@@ -0,0 +1,7 @@
class Test<T> {
fun foo() {}
fun test() {
foo()
}
}
@@ -0,0 +1,6 @@
val <T> <caret>T.bar: Int
get() = 1
fun test() {
"".bar
}
@@ -0,0 +1,6 @@
val bar: Int
get() = 1
fun test() {
bar
}
@@ -0,0 +1,8 @@
class Test<T> {
val <caret>T.bar: Int
get() = 1
fun test(t: T) {
t.bar
}
}
@@ -0,0 +1,8 @@
class Test<T> {
val bar: Int
get() = 1
fun test(t: T) {
bar
}
}
@@ -0,0 +1,8 @@
class Test<T> {
val <S> <caret>S.bar: Int
get() = 1
fun test() {
"".bar
}
}
@@ -0,0 +1,8 @@
class Test<T> {
val bar: Int
get() = 1
fun test() {
bar
}
}