Merge ReplaceJavaIntegerToStringWithMemberInspection and ReplaceJavaStaticMethodWithTopLevelFunctionInspection

Relates to #KT-12721
This commit is contained in:
Dmitry Gridin
2019-04-11 11:27:14 +07:00
parent 6b7f4dda31
commit 6afc0367c0
19 changed files with 72 additions and 116 deletions
@@ -0,0 +1,7 @@
// WITH_RUNTIME
// PROBLEM: none
// ERROR: None of the following functions can be called with the arguments supplied: <br>public open fun toString(i: Int): String! defined in java.lang.Integer<br>public open fun toString(i: Int, radix: Int): String! defined in java.lang.Integer
fun main() {
println(Integer.toString(<caret>))
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = Integer.<caret>toString(5) + 7
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
val t = 5.toString() + 7
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
val b = listOf(42, 10)
println(Integer<caret>.toString(b.first(), b.last()).let{it} + 1)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
val b = listOf(42, 10)
println(b.first().toString(b.last()).let{it} + 1)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
Integer.<caret>toString(5)
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
fun foo() {
5.toString()
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo() {
val list = arrayListOf<Int>()
list.add(5)
Integer.<caret>toString(list[0])
}
@@ -0,0 +1,7 @@
// WITH_RUNTIME
fun foo() {
val list = arrayListOf<Int>()
list.add(5)
list[0].toString()
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
var number = 5
val numberString = Integer.<caret>toString(number)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
var number = 5
val numberString = number.toString()
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
var number = 5
val numberString = Integer.<caret>toString(number, 2)
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun foo() {
var number = 5
val numberString = number.toString(2)
}