Inspection to warn on using == with array types #KT-13384 Fixed
This commit is contained in:
committed by
Mikhail Glukhikh
parent
7d35316d95
commit
1bbde54e9d
@@ -0,0 +1 @@
|
||||
org.jetbrains.kotlin.idea.intentions.ReplaceArrayEqualityOpWithArraysEqualsIntention
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b: Any? = null
|
||||
if (a <caret>== b) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
if (a <caret>== b) {
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.Arrays
|
||||
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
fun foo() {
|
||||
val a = arrayOf("a", "b", "c")
|
||||
val b = arrayOf("a", "b", "c")
|
||||
if (Arrays.equals(a, b)) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user