Name suggester: Improve name suggestion strategy for type parameters

This commit is contained in:
Alexey Sedunov
2014-10-31 15:03:08 +03:00
parent 7cb77314bc
commit f81c2d5ff7
11 changed files with 46 additions and 15 deletions
@@ -1,7 +1,7 @@
// "Create function 'foo'" "true"
class B<T>(val t: T) {
fun <T1, T2> foo(arg: T1, arg1: T2): T1 {
fun <U, V> foo(arg: U, arg1: V): U {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -1,7 +1,7 @@
// "Create function 'foo'" "true"
class B<T>(val t: T) {
fun <T1> foo(i: Int, arg: T1): Int {
fun <U> foo(i: Int, arg: U): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -1,7 +1,7 @@
// "Create function 'foo'" "true"
class B<T>(val t: T) {
fun <T1, T2> foo(arg: T1, arg1: T2): T1 {
fun <U, V> foo(arg: U, arg1: V): U {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -6,6 +6,6 @@ class A<T>(val items: List<T>) {
}
}
fun <E, T, T1> List<E>.foo(arg: T, arg1: T1): T {
fun <E, T, U> List<E>.foo(arg: T, arg1: U): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -6,6 +6,6 @@ class A<T>(val items: List<T>) {
}
}
fun <E, T, T1> List<E>.foo(arg: T, arg1: T1): T {
fun <E, T, U> List<E>.foo(arg: T, arg1: U): T {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -4,6 +4,6 @@ fun test(): Int {
return foo<String, Int>(2, "2")
}
fun <T, T1> foo(arg: T1, arg1: T): T1 {
fun <T, U> foo(arg: U, arg1: T): U {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -4,6 +4,6 @@ fun test(): Int {
return foo<String, Int, Boolean>(2, "2")
}
fun <T, T1, T2> foo(arg: T1, arg1: T): T1 {
fun <T, U, V> foo(arg: U, arg1: T): U {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -4,6 +4,6 @@ fun test(): Int {
return foo<String, Int>(2, "2")
}
fun <T, T1> foo(arg: T1, arg1: T): T1 {
fun <T, U> foo(arg: U, arg1: T): U {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}