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
@@ -1,7 +1,7 @@
// "Create member function 'inc'" "true"
class A<T>(val n: T) {
fun inc(): A<T> {
operator fun inc(): 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 minus(n: Int): A<T> = throw Exception()
fun minus(): A<T> {
operator fun minus(): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -4,6 +4,6 @@ fun test() {
val a = -false
}
fun Boolean.minus(): Any {
operator fun Boolean.minus(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -1,7 +1,7 @@
// "Create member function 'minus'" "true"
class A<T>(val n: T) {
fun minus(): Any {
operator fun minus(): Any {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'minus'" "true"
class A<T>(val n: T) {
fun minus(): A<T> {
operator fun minus(): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}