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:
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val c: Collection<String> = listOf("")
|
||||
c.size<caret> > 0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val c: Collection<String> = listOf("")
|
||||
c.isNotEmpty()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val m = mapOf("" to 1)
|
||||
m.size<caret> > 0
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val m = mapOf("" to 1)
|
||||
m.isNotEmpty()
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val a = intArrayOf(1, 2, 3)
|
||||
a.size<caret> > 0
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val a = intArrayOf(1, 2, 3)
|
||||
a.isNotEmpty()
|
||||
}
|
||||
Reference in New Issue
Block a user