Files
Ivan Kochurkin d50c6f1b6d [FIR] Fix missing USELESS_CAST
`FirUselessTypeOperationCallChecker` always checks exact types matching for `as` operator

Simplify code of cast checker and utils

^KT-56629 Fixed
^KT-56615 Fixed
^KT-59820 Fixed
2023-10-24 20:59:56 +00:00

12 lines
206 B
Kotlin
Vendored

// ISSUE: KT-44392, KT-56615
fun test_1(a: Any?) {
(a as String?)!!
(a <!USELESS_CAST!>as? String<!>)!!
}
fun test_2(a: Any?) {
(a as String?)!!
a<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>
}