[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
This commit is contained in:
committed by
Space Team
parent
2f8026f335
commit
d50c6f1b6d
Vendored
+1
-1
@@ -111,7 +111,7 @@ fun case_9(value_1: Any) {
|
||||
fun case_10(value_1: Collection<Int>, value_2: Collection<Int>, value_3: Collection<Int>?) {
|
||||
when (value_1) {
|
||||
value_2 as List<Int> -> {}
|
||||
value_2 as? List<Int> -> {}
|
||||
value_2 <!USELESS_CAST!>as? List<Int><!> -> {}
|
||||
value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!> -> {}
|
||||
(value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int> -> {}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -82,7 +82,7 @@ fun case_9(value_1: Any) {
|
||||
// TESTCASE NUMBER: 10
|
||||
fun case_10(value_1: Collection<Int>, value_2: Collection<Int>, value_3: Collection<Int>?) {
|
||||
when (value_1) {
|
||||
value_2 as List<Int>, value_2 as? List<Int> -> {}
|
||||
value_2 as List<Int>, value_2 <!USELESS_CAST!>as? List<Int><!> -> {}
|
||||
value_3 <!UNCHECKED_CAST!>as? MutableMap<Int, Int><!>, (value_2 <!UNCHECKED_CAST!>as? Map<Int, Int><!>) as MutableMap<Int, Int> -> {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user