Create from Usage: Add infix modifier to functions generated from binary expressions
#KT-10184 Fixed
This commit is contained in:
+1
-1
@@ -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
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
idea/testData/quickfix/createFromUsage/createFunction/binaryOperations/plusAssignOnUserType.kt.after
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -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.
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user