ReplaceJavaStaticMethodWithKotlinAnalogInspection: introduce Transformation for extension with non-null receiver
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
// WITH_RUNTIME
|
||||
// PROBLEM: none
|
||||
import java.util.Arrays
|
||||
|
||||
fun test() {
|
||||
val a: Array<*>? = arrayOf(1)
|
||||
val str = Arrays.<caret>toString(a)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val a: Int? = 5
|
||||
val t: String = Integer.<caret>toString(a)
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun foo() {
|
||||
val a: Int? = 5
|
||||
val t: String = a.toString()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// PROBLEM: none
|
||||
// ERROR: Type mismatch: inferred type is Int? but Int was expected
|
||||
fun foo() {
|
||||
val a: Int? = 5
|
||||
val t: String = Integer.<caret>toString(a, 5)
|
||||
}
|
||||
Reference in New Issue
Block a user