FIR checkers: report SMARTCAST_IMPOSSIBLE

This commit is contained in:
Tianyu Geng
2021-05-08 20:51:02 -07:00
committed by TeamCityServer
parent 2bb7ef9747
commit ce767046eb
58 changed files with 347 additions and 268 deletions
@@ -11,7 +11,7 @@ fun valuesNullable(map: MutableMap<Int, String?>) {
// ORIGINAL: fun merge(K, V, BiFunction<in V, in V, out V?>): V? defined in kotlin.collections.MutableMap
// SUBSTITUTED: fun merge(Int, String, BiFunction<in String, in String, out String?>): String? defined in kotlin.collections.MutableMap
map.merge(1, null) { old, new -> old + new }
// OTHER_ERROR
// UNSAFE_CALL_ERROR
// ORIGINAL: fun merge(K, V, BiFunction<in V, in V, out V?>): V? defined in kotlin.collections.MutableMap
// SUBSTITUTED: fun merge(Int, String, BiFunction<in String, in String, out String?>): String? defined in kotlin.collections.MutableMap
}
@@ -32,7 +32,7 @@ fun <T : Any> valuesTNotNull(map: MutableMap<Int, T>, newValue: T) {
fun <T : Any> valuesTNullable(map: MutableMap<Int, T?>, newValue: T?) {
map.merge(1, newValue) { old, new -> new }
// OTHER_ERROR
// UNSAFE_CALL_ERROR
// ORIGINAL: fun merge(K, V, BiFunction<in V, in V, out V?>): V? defined in kotlin.collections.MutableMap
// SUBSTITUTED: fun merge(Int, T, BiFunction<in T, in T, out T?>): T? defined in kotlin.collections.MutableMap
map.merge(1, newValue!!) { old, new -> new }
@@ -3,7 +3,7 @@ import java.util.*
fun use() {
val x: String? = "x"
Optional.of(x)
// OTHER_ERROR
// UNSAFE_CALL_ERROR
// ORIGINAL: fun <T : Any!> of(T): Optional<T> defined in java.util.Optional
// SUBSTITUTED: fun <T : Any!> of(String): Optional<String> defined in java.util.Optional