[FIR] Fix tests (ARGUMENT_TYPE_MISMATCH instead of INCOMPATIBLE_CANDIDATE)

This commit is contained in:
Ivan Kochurkin
2021-04-06 01:35:30 +03:00
committed by TeamCityServer
parent 4ffab5fe5a
commit ad9b962536
461 changed files with 1239 additions and 1246 deletions
@@ -22,5 +22,5 @@ interface TypePredicate : (KotlinType) -> Boolean {
fun <T : Any?> TypePredicate.expectedTypeFor(keys: Iterable<T>): Map<T, TypePredicate> =
keys.fold(SmartFMap.emptyMap<T, TypePredicate>()) { map, key ->
map.<!INAPPLICABLE_CANDIDATE!>plus<!>(key, this)
map.plus(<!ARGUMENT_TYPE_MISMATCH!>key<!>, this)
}
@@ -21,12 +21,12 @@ fun test(
invOut.onlyOut(42)
invOut.onlyOut(1L)
invOut.<!INAPPLICABLE_CANDIDATE!>onlyOutUB<!>("str")
invOut.onlyOutUB(<!ARGUMENT_TYPE_MISMATCH!>"str"<!>)
invStar.<!INAPPLICABLE_CANDIDATE!>onlyOutUB<!>(0)
invOut.onlyOutUB(42)
invOut.onlyOutUB(1L)
invIn.<!INAPPLICABLE_CANDIDATE!>onlyIn<!>("str")
invIn.onlyIn(<!ARGUMENT_TYPE_MISMATCH!>"str"<!>)
invIn.onlyIn(42)
invIn.onlyIn(1L)
}
@@ -21,5 +21,5 @@ fun main() {
// Here, the error should be
val x2: (Int) -> Unit = takeSuspend(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>id { it }<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>{ x -> x }<!>)
val x3: suspend (Int) -> Unit = takeSimpleFunction(<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>id { it }<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.coroutines.SuspendFunction1<kotlin.Int, kotlin.Unit>")!>{ x -> x }<!>)
val x4: (Int) -> Unit = <!INAPPLICABLE_CANDIDATE!>takeSimpleFunction<!>(id<suspend (Int) -> Unit> {}, <!DEBUG_INFO_EXPRESSION_TYPE("Type is unknown")!>{}<!>)
val x4: (Int) -> Unit = takeSimpleFunction(<!ARGUMENT_TYPE_MISMATCH!>id<suspend (Int) -> Unit> {}<!>, <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Function1<kotlin.Int, kotlin.Unit>")!>{}<!>)
}
@@ -10,7 +10,7 @@ fun <T : Any> T?.sure() : T = this!!
fun <E> List<*>.toArray(ar: Array<E>): Array<E> = ar
fun testArrays(ci: List<Int?>, cii: List<Int?>?) {
val c1: Array<Int?> = cii.sure().<!INAPPLICABLE_CANDIDATE!>toArray<!>(Array<Int?>)
val c1: Array<Int?> = cii.sure().toArray(<!ARGUMENT_TYPE_MISMATCH!>Array<!><Int?>)
val c2: Array<Int?> = ci.toArray(Array<Int?>(<!NO_VALUE_FOR_PARAMETER, NO_VALUE_FOR_PARAMETER!>)<!>)
@@ -4,6 +4,6 @@
class Base<T : T> : HashSet<T>() {
fun foo() {
super.<!INAPPLICABLE_CANDIDATE!>remove<!>("")
super.remove(<!ARGUMENT_TYPE_MISMATCH!>""<!>)
}
}
@@ -3,7 +3,7 @@ private const val dateRangeEnd: String = "2020-05-01"
private fun String?.toIconList(): List<String> = when (this) {
null -> listOf("DATE_IS_NULL")
<!INAPPLICABLE_CANDIDATE!>in<!> dateRangeStart..dateRangeEnd -> emptyList()
<!ARGUMENT_TYPE_MISMATCH!>in dateRangeStart..dateRangeEnd<!> -> emptyList()
else -> listOf("DATE_IS_OUT_OF_RANGE")
}