Create from Usage: Add infix modifier to functions generated from binary expressions

#KT-10184 Fixed
This commit is contained in:
Alexey Sedunov
2015-11-26 13:37:43 +03:00
parent 5b90c09ab1
commit e37eea2b2d
18 changed files with 21 additions and 18 deletions
@@ -1,7 +1,7 @@
// "Create member function 'foo'" "true"
class A<T>(val n: T) {
fun foo(t: T): A<T> {
infix 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 member function 'compareTo'" "true"
class A<T>(val n: T) {
operator fun compareTo(t: T): Int {
infix operator fun compareTo(t: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'contains'" "true"
class A<T>(val n: T) {
operator fun contains(t: T): Boolean {
infix operator fun contains(t: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'compareTo'" "true"
class A<T>(val n: T) {
operator fun compareTo(t: T): Int {
infix operator fun compareTo(t: T): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'contains'" "true"
class A<T>(val n: T) {
operator fun contains(t: T): Boolean {
infix operator fun contains(t: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'plusAssign'" "true"
class A<T>(val n: T) {
operator fun plusAssign(t: T) {
infix operator fun plusAssign(t: 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) {
operator fun unaryPlus(): A<T> = throw Exception()
operator fun plus(t: T): A<T> {
infix operator fun plus(t: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'plus'" "true"
class A<T>(val n: T) {
operator fun plus(t: T): A<T> {
infix operator fun plus(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 plus(i: Int, s: String): A<T> = throw Exception()
operator fun plus(t: T): A<T> {
infix operator fun plus(t: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -6,6 +6,6 @@ fun test() {
val a: A<Int> = 2 + A(1)
}
operator fun Int.plus(a: A<Int>): A<Int> {
infix operator fun Int.plus(a: A<Int>): A<Int> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -1,7 +1,7 @@
// "Create member function 'plus'" "true"
class A<T>(val n: T) {
operator fun plus(t: T): A<T> {
infix operator fun plus(t: T): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'plus'" "true"
class A<T>(val n: T) {
operator fun plus(i: Int): A<T> {
infix operator fun plus(i: Int): A<T> {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -3,6 +3,6 @@ fun test() {
val t: Int = 1 `!u00A0` 2
}
fun Int.`!u00A0`(i: Int): Int {
infix fun Int.`!u00A0`(i: Int): Int {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
@@ -1,7 +1,7 @@
// "Create member function 'contains'" "true"
class A<T>(val n: T) {
operator fun contains(t: T): Boolean {
infix operator fun contains(t: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}
@@ -1,7 +1,7 @@
// "Create member function 'contains'" "true"
class A<T>(val n: T) {
operator fun contains(t: T): Boolean {
infix operator fun contains(t: T): Boolean {
throw UnsupportedOperationException("not implemented") //To change body of created functions use File | Settings | File Templates.
}
}