KT-9981 Code cleanup replace usages of !in incorrectly
#KT-9981 Fixed
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
// "Replace usages of 'contains(String) on C: Boolean' in whole project" "true"
|
||||
|
||||
class C
|
||||
|
||||
@Deprecated("", ReplaceWith("checkContains(s)"))
|
||||
operator fun C.contains(s: String) = true
|
||||
|
||||
fun C.checkContains(s: String) = true
|
||||
|
||||
fun f(c: C) {
|
||||
if ("" <caret>!in c) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun g(c: C) {
|
||||
if ("" in c) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// "Replace usages of 'contains(String) on C: Boolean' in whole project" "true"
|
||||
|
||||
class C
|
||||
|
||||
@Deprecated("", ReplaceWith("checkContains(s)"))
|
||||
operator fun C.contains(s: String) = true
|
||||
|
||||
fun C.checkContains(s: String) = true
|
||||
|
||||
fun f(c: C) {
|
||||
if (!c.checkContains("")) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun g(c: C) {
|
||||
if (c.checkContains("")) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'add(c)'" "true"
|
||||
class C
|
||||
|
||||
@Deprecated("", ReplaceWith("add(c)"))
|
||||
operator fun C.plus(c: C) = C()
|
||||
|
||||
fun C.add(c: C) = C()
|
||||
|
||||
fun f() {
|
||||
var c1 = C()
|
||||
c1 <caret>+= C()
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// "Replace with 'add(c)'" "true"
|
||||
class C
|
||||
|
||||
@Deprecated("", ReplaceWith("add(c)"))
|
||||
operator fun C.plus(c: C) = C()
|
||||
|
||||
fun C.add(c: C) = C()
|
||||
|
||||
fun f() {
|
||||
var c1 = C()
|
||||
c1 = c1.add(C())
|
||||
}
|
||||
Reference in New Issue
Block a user