Add "'equals()' between objects of inconvertible types" inspection
#KT-25006 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a1979677d0
commit
a2205cfc98
+3
@@ -0,0 +1,3 @@
|
||||
// PROBLEM: none
|
||||
|
||||
val x = 2.<caret>equals("")
|
||||
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.inspections.KotlinEqualsBetweenInconvertibleTypesInspection
|
||||
@@ -0,0 +1,8 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: E1, y: E1): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: E1, y: E2): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
|
||||
enum class E2
|
||||
@@ -0,0 +1,7 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: E1, y: Int): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: E1, y: String): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: E1, y: Foo): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
class Foo
|
||||
|
||||
enum class E1
|
||||
@@ -0,0 +1,7 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: Int, y: E1): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: Int, y: Int): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: Int, y: Long): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: Int, y: String): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: Int, y: Foo): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
class Foo
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// FIX: none
|
||||
enum class E1
|
||||
|
||||
fun test(x: E1?, y: String): Boolean? {
|
||||
return x?.<caret>equals(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// FIX: none
|
||||
fun test(x: Int?, y: String): Boolean? {
|
||||
return x?.<caret>equals(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// FIX: none
|
||||
fun test(x: String?, y: Int): Boolean? {
|
||||
return x?.<caret>equals(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// PROBLEM: none
|
||||
fun test() {
|
||||
System.getProperty("some")?.<caret>equals("true")
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: String, y: E1): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
enum class E1
|
||||
@@ -0,0 +1,5 @@
|
||||
// FIX: none
|
||||
|
||||
fun test(x: String, y: Int): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// FIX: none
|
||||
enum class E1
|
||||
|
||||
fun test(x: String, y: E1?): Boolean? {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// FIX: none
|
||||
fun test(x: String, y: Int?): Boolean? {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// PROBLEM: none
|
||||
fun test(x: String, y: String?): Boolean? {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: String, y: String): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: String, y: Foo): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
class Foo
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// PROBLEM: none
|
||||
|
||||
fun test(x: Foo, y: Int): Boolean {
|
||||
return x.<caret>equals(y)
|
||||
}
|
||||
|
||||
class Foo
|
||||
Reference in New Issue
Block a user