[IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
17df843bf1
commit
05aa36a858
@@ -1,3 +1,4 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:-NewInference
|
||||
// PROBLEM: none
|
||||
// ERROR: Type mismatch: inferred type is Long? but Long was expected
|
||||
fun test(b: Boolean, x: Long, y: Long?) {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+NewInference
|
||||
// PROBLEM: Assignment should be lifted out of 'if'
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public final operator fun plus(other: Byte): Long defined in kotlin.Long<br>public final operator fun plus(other: Double): Double defined in kotlin.Long<br>public final operator fun plus(other: Float): Float defined in kotlin.Long<br>public final operator fun plus(other: Int): Long defined in kotlin.Long<br>public final operator fun plus(other: Long): Long defined in kotlin.Long<br>public final operator fun plus(other: Short): Long defined in kotlin.Long
|
||||
|
||||
fun test(b: Boolean, x: Long, y: Long?) {
|
||||
var num: Long = 0L
|
||||
<caret>if (b) {
|
||||
num += x
|
||||
} else {
|
||||
num += y
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+NewInference
|
||||
// PROBLEM: Assignment should be lifted out of 'if'
|
||||
// ERROR: None of the following functions can be called with the arguments supplied: <br>public final operator fun plus(other: Byte): Long defined in kotlin.Long<br>public final operator fun plus(other: Double): Double defined in kotlin.Long<br>public final operator fun plus(other: Float): Float defined in kotlin.Long<br>public final operator fun plus(other: Int): Long defined in kotlin.Long<br>public final operator fun plus(other: Long): Long defined in kotlin.Long<br>public final operator fun plus(other: Short): Long defined in kotlin.Long
|
||||
|
||||
fun test(b: Boolean, x: Long, y: Long?) {
|
||||
var num: Long = 0L
|
||||
num += if (b) {
|
||||
x
|
||||
} else {
|
||||
y
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:-NewInference
|
||||
// PROBLEM: none
|
||||
// ERROR: Type mismatch: inferred type is List<Any> but MutableList<Int> was expected
|
||||
// ERROR: Val cannot be reassigned
|
||||
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// COMPILER_ARGUMENTS: -XXLanguage:+NewInference
|
||||
// PROBLEM: none
|
||||
// ERROR: Type mismatch: inferred type is List<{Comparable<{Int & Long}> & Number}> but MutableList<Int> was expected
|
||||
// ERROR: Val cannot be reassigned
|
||||
// WITH_RUNTIME
|
||||
|
||||
fun test(b: Boolean) {
|
||||
val list = mutableListOf<Int>()
|
||||
<caret>if (b) {
|
||||
list += mutableListOf(1)
|
||||
} else {
|
||||
list += mutableListOf(2L)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user