Replace with binary operator: don't suggest for non-operator function
#KT-12273 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
ea0f9d124d
commit
f2cf3a8e7b
+5
@@ -0,0 +1,5 @@
|
||||
public class Operation {
|
||||
public int compareTo(Operation other) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public class Operation {
|
||||
public int compareTo(Operation other) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with '<'
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1.<caret>compareTo(p2) < 0
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with '<'
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1 < p2
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1.<caret>compareTo(p2) < 0
|
||||
}
|
||||
|
||||
class Operation {
|
||||
fun compareTo(other: Operation) = 0
|
||||
}
|
||||
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1.<caret>plus(p2)
|
||||
}
|
||||
|
||||
class Operation {
|
||||
fun plus(other: Operation) = 0
|
||||
}
|
||||
idea/testData/inspectionsLocal/conventionNameCalls/replaceCallWithBinaryOperator/plusFromJava.1.java
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
public class Operation {
|
||||
public int plus(Operation other) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
public class Operation {
|
||||
public int plus(Operation other) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with '+'
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1.<caret>plus(p2)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// FIX: Replace with '+'
|
||||
|
||||
fun test(p1: Operation, p2: Operation) {
|
||||
p1 + p2
|
||||
}
|
||||
Reference in New Issue
Block a user