Fix 'in' operator intention for Strings (KT-13974)

This commit is contained in:
takahirom
2016-09-27 01:56:05 +09:00
committed by Dmitry Jemerov
parent 93c2e7dfc0
commit 925c48c2f0
8 changed files with 42 additions and 10 deletions
@@ -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")
}
@@ -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
}
@@ -0,0 +1,5 @@
class Container {
public boolean contains(int x, int y) {
return true;
}
}
@@ -0,0 +1,5 @@
class Container {
public boolean contains(int x, int y) {
return true;
}
}
@@ -0,0 +1,6 @@
// IS_APPLICABLE: false
fun foo() {
val c = Container()
c.cont<caret>ains(1, 2)
}
@@ -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)
}