teach 'create from usage' to add 'operator' modifier when necessary
This commit is contained in:
+1
-1
@@ -6,6 +6,6 @@ fun test(): A<String> {
|
||||
return 1(2, "2")
|
||||
}
|
||||
|
||||
fun Int.invoke(i: Int, s: String): A<String> {
|
||||
operator fun Int.invoke(i: Int, s: String): A<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun invoke(t: T, s: String): B<String> {
|
||||
operator fun invoke(t: T, s: String): B<String> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
idea/testData/quickfix/createFromUsage/createFunction/invoke/invokeOnUserTypeWithTypeParams.kt.after
Vendored
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun <V> invoke(u: T, s: String): B<V> {
|
||||
operator fun <V> invoke(u: T, s: String): B<V> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Create member function 'invoke'" "true"
|
||||
|
||||
class A<T>(val n: T) {
|
||||
fun invoke(abc: T, ghi: A<T>, def: String): A<T> {
|
||||
operator fun invoke(abc: T, ghi: A<T>, def: String): A<T> {
|
||||
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user