Name suggester: Respect type parameter name when suggesting name for
variables based on that type parameter
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T): A<T> {
|
||||
fun foo(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'compareTo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun compareTo(arg: T): Int {
|
||||
fun compareTo(t: T): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'contains'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun contains(arg: T): Boolean {
|
||||
fun contains(t: T): Boolean {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'compareTo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun compareTo(arg: T): Int {
|
||||
fun compareTo(t: T): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'contains'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun contains(arg: T): Boolean {
|
||||
fun contains(t: T): Boolean {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'plusAssign'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plusAssign(arg: T) {
|
||||
fun plusAssign(t: T) {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
class A<T>(val n: T) {
|
||||
fun plus(): A<T> = throw Exception()
|
||||
|
||||
fun plus(arg: T): A<T> {
|
||||
fun plus(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plus(arg: T): A<T> {
|
||||
fun plus(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
class A<T>(val n: T) {
|
||||
fun plus(i: Int, s: String): A<T> = throw Exception()
|
||||
|
||||
fun plus(arg: T): A<T> {
|
||||
fun plus(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'plus'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun plus(arg: T): A<T> {
|
||||
fun plus(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'contains'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun contains(arg: T): Boolean {
|
||||
fun contains(t: T): Boolean {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'contains'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun contains(arg: T): Boolean {
|
||||
fun contains(t: T): Boolean {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T, s: String, function: Function1<T, T>): A<T> {
|
||||
fun foo(t: T, s: String, function: Function1<T, T>): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class A<T>(val n: T) {
|
||||
fun foo(a: Int): A<T> = throw Exception()
|
||||
|
||||
fun foo(arg: T, s: String): A<T> {
|
||||
fun foo(t: T, s: String): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
class A<T>(val n: T) {
|
||||
fun foo(i: Int, s: String): A<T> = throw Exception()
|
||||
|
||||
fun foo(arg: T): A<T> {
|
||||
fun foo(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T): A<T> {
|
||||
fun foo(t: T): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T?): A<Int> {
|
||||
fun foo(t: T?): A<Int> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T): A<T>? {
|
||||
fun foo(t: T): A<T>? {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(arg: T): A<String> {
|
||||
fun foo(t: T): A<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// ERROR: <html>Type mismatch.<table><tr><td>Required:</td><td>kotlin.Int</td></tr><tr><td>Found:</td><td>A<kotlin.Int></td></tr></table></html>
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(s: String, arg: T): Any {
|
||||
fun foo(s: String, t: T): Any {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// ERROR: Unresolved reference: s
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun foo(s: Any, arg: T): T {
|
||||
fun foo(s: Any, t: T): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class B<T>(val t: T) {
|
||||
fun <U, V> foo(arg: U, arg1: V): U {
|
||||
fun <U, V> foo(u: U, v: V): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class B<T>(val t: T) {
|
||||
fun <U> foo(i: Int, arg: U): Int {
|
||||
fun <U> foo(i: Int, u: U): Int {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'foo'" "true"
|
||||
|
||||
class B<T>(val t: T) {
|
||||
fun <U, V> foo(arg: U, arg1: V): U {
|
||||
fun <U, V> foo(u: U, v: V): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,6 +6,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T, U> List<E>.foo(arg: T, arg1: U): T {
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T> List<E>.foo(arg: T, s: String): T {
|
||||
fun <E, T> List<E>.foo(t: T, s: String): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -6,6 +6,6 @@ class A<T>(val items: List<T>) {
|
||||
}
|
||||
}
|
||||
|
||||
fun <E, T, U> List<E>.foo(arg: T, arg1: U): T {
|
||||
fun <E, T, U> List<E>.foo(t: T, u: U): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ fun test(): Int {
|
||||
return foo<String, Int>(2, "2")
|
||||
}
|
||||
|
||||
fun <T, U> foo(arg: U, arg1: T): U {
|
||||
fun <T, U> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ fun test(): Int {
|
||||
return foo<String, Int, Boolean>(2, "2")
|
||||
}
|
||||
|
||||
fun <T, U, V> foo(arg: U, arg1: T): U {
|
||||
fun <T, U, V> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ fun test(): Int {
|
||||
return foo<String, Int>(2, "2")
|
||||
}
|
||||
|
||||
fun <T, U> foo(arg: U, arg1: T): U {
|
||||
fun <T, U> foo(u: U, t: T): U {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -4,6 +4,6 @@ fun test(): Int {
|
||||
return foo<Int>(2, "2")
|
||||
}
|
||||
|
||||
fun <T> foo(arg: T, s: String): T {
|
||||
fun <T> foo(t: T, s: String): T {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun invoke(arg: T, s: String): B<String> {
|
||||
fun invoke(t: T, s: String): B<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user