[IDE-NI-MIGRATE] [BAD] Migrate testdata of LocalInspection tests

This commit is contained in:
Dmitriy Novozhilov
2019-04-22 18:49:50 +03:00
committed by Mikhail Zarechenskiy
parent 17df843bf1
commit 05aa36a858
20 changed files with 186 additions and 0 deletions
@@ -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
}
}
@@ -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,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
@@ -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)
}
}