Improve Collection/Array/String detection logic in intentions
Use static methods from KotlinBuiltIns and check all supertypes, support cases of Collection, Map and CharSequence
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
fun foo() {
|
||||
val a = charArrayOf('a', 'b', 'c')
|
||||
val b = charArrayOf('a', 'b', 'c')
|
||||
if (a <caret>== b) {
|
||||
}
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
import java.util.Arrays
|
||||
|
||||
// WITH_RUNTIME
|
||||
// INTENTION_TEXT: Replace '==' with 'Arrays.equals'
|
||||
fun foo() {
|
||||
val a = charArrayOf('a', 'b', 'c')
|
||||
val b = charArrayOf('a', 'b', 'c')
|
||||
if (Arrays.equals(a, b)) {
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user