teach 'create from usage' to add 'operator' modifier when necessary

This commit is contained in:
Dmitry Jemerov
2015-09-24 16:28:03 +02:00
parent bda0bd1de1
commit 3dbb74bf0c
35 changed files with 54 additions and 47 deletions
@@ -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,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.
}
}
@@ -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,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.
}
}