Fix 'in' operator intention for Strings (KT-13974)
This commit is contained in:
committed by
Dmitry Jemerov
parent
93c2e7dfc0
commit
925c48c2f0
+6
@@ -0,0 +1,6 @@
|
||||
@Suppress("INAPPLICABLE_OPERATOR_MODIFIER")
|
||||
public operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean = false
|
||||
fun test() {
|
||||
val foo = "foo"
|
||||
foo.c<caret>ontains("bar")
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
@Suppress("INAPPLICABLE_OPERATOR_MODIFIER")
|
||||
public operator fun CharSequence.contains(other: CharSequence, ignoreCase: Boolean = false): Boolean = false
|
||||
fun test() {
|
||||
val foo = "foo"
|
||||
"bar" in foo
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
class Container {
|
||||
public boolean contains(int x, int y) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
class Container {
|
||||
public boolean contains(int x, int y) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun foo() {
|
||||
val c = Container()
|
||||
c.cont<caret>ains(1, 2)
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// IS_APPLICABLE: false
|
||||
|
||||
fun test() {
|
||||
class Test{
|
||||
fun contains(a: Int) : Boolean = true
|
||||
}
|
||||
val test = Test()
|
||||
test.c<caret>ontains(0)
|
||||
}
|
||||
Reference in New Issue
Block a user