Adjust testData to CharSequence.length transformation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
cb562e7ea5
commit
f0e3fd617d
@@ -6,5 +6,5 @@ fun oldFun(): String = ""
|
||||
fun newFun(): String = ""
|
||||
|
||||
fun foo() {
|
||||
val value = <caret>oldFun().length()
|
||||
val value = <caret>oldFun().length
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ fun oldFun(): String = ""
|
||||
fun newFun(): String = ""
|
||||
|
||||
fun foo() {
|
||||
val value = <caret>newFun().length()
|
||||
val value = <caret>newFun().length
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ fun Int.newFun(): Int = this
|
||||
fun foo(list: List<String>): Int {
|
||||
return list
|
||||
.filter { it.isNotEmpty() }
|
||||
.map { it.length() }
|
||||
.map { it.length }
|
||||
.first()
|
||||
.<caret>oldFun()
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ fun Int.newFun(): Int = this
|
||||
fun foo(list: List<String>): Int {
|
||||
return list
|
||||
.filter { it.isNotEmpty() }
|
||||
.map { it.length() }
|
||||
.map { it.length }
|
||||
.first()
|
||||
.<caret>newFun()
|
||||
}
|
||||
|
||||
+2
-2
@@ -2,9 +2,9 @@
|
||||
|
||||
interface I {
|
||||
@Deprecated("", ReplaceWith("newFun(p1, p2, p3)"))
|
||||
fun oldFun(p1: String, p2: Int = p1.length(), p3: String? = p1)
|
||||
fun oldFun(p1: String, p2: Int = p1.length, p3: String? = p1)
|
||||
|
||||
fun newFun(x: String, y: Int = x.length(), z: String? = "a")
|
||||
fun newFun(x: String, y: Int = x.length, z: String? = "a")
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
|
||||
Vendored
+2
-2
@@ -2,9 +2,9 @@
|
||||
|
||||
interface I {
|
||||
@Deprecated("", ReplaceWith("newFun(p1, p2, p3)"))
|
||||
fun oldFun(p1: String, p2: Int = p1.length(), p3: String? = p1)
|
||||
fun oldFun(p1: String, p2: Int = p1.length, p3: String? = p1)
|
||||
|
||||
fun newFun(x: String, y: Int = x.length(), z: String? = "a")
|
||||
fun newFun(x: String, y: Int = x.length, z: String? = "a")
|
||||
}
|
||||
|
||||
fun foo(i: I) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Remove cast" "true"
|
||||
fun test(x: Any): Int {
|
||||
if (x is String) {
|
||||
return (x <caret>as String).length()
|
||||
return (x <caret>as String).length
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// "Remove cast" "true"
|
||||
fun test(x: Any): Int {
|
||||
if (x is String) {
|
||||
return x.length()
|
||||
return x.length
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unnecessary non-null assertion (!!)" "true"
|
||||
fun test(value : String) : Int {
|
||||
return value<caret>!!.length()
|
||||
return value<caret>!!.length
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// "Remove unnecessary non-null assertion (!!)" "true"
|
||||
fun test(value : String) : Int {
|
||||
return value<caret>.length()
|
||||
return value<caret>.length
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Add constructor parameters from Base(String)" "true"
|
||||
open class Base private constructor(p1: Int, val p2: Int) {
|
||||
private constructor() : this(0, 1)
|
||||
protected constructor(s: String) : this(s.length(), 1)
|
||||
protected constructor(s: String) : this(s.length, 1)
|
||||
}
|
||||
|
||||
class C : Base<caret>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "Add constructor parameters from Base(String)" "true"
|
||||
open class Base private constructor(p1: Int, val p2: Int) {
|
||||
private constructor() : this(0, 1)
|
||||
protected constructor(s: String) : this(s.length(), 1)
|
||||
protected constructor(s: String) : this(s.length, 1)
|
||||
}
|
||||
|
||||
class C(s: String) : Base<caret>(s)
|
||||
|
||||
Reference in New Issue
Block a user