[FIR] Fix false positive USELESS_CAST on stub types, ^KT-50293 Fixed

This commit is contained in:
Ivan Kochurkin
2022-06-05 21:53:54 +03:00
committed by teamcity
parent 856d14e5f7
commit fd2b4fd497
17 changed files with 34 additions and 24 deletions
@@ -1,12 +0,0 @@
// WITH_STDLIB
// For FIR: see KT-50293
fun main() {
val list = buildList {
add("one")
add("two")
val secondParameter = get(1)
println(secondParameter <!USELESS_CAST!>as String<!>) // WARNING: [CAST_NEVER_SUCCEEDS] This cast can never succeed
}
}
@@ -1,5 +1,6 @@
// FIR_IDENTICAL
// WITH_STDLIB
// For FIR: see KT-50293
// ISSUE: KT-50293
fun main() {
val list = buildList {
@@ -7,6 +8,6 @@ fun main() {
add("two")
val secondParameter = get(1)
println(secondParameter as String) // WARNING: [CAST_NEVER_SUCCEEDS] This cast can never succeed
println(secondParameter as String)
}
}