[FIR] Merge the two type operator checkers into a single one
This way it's easier to reason about where useless casts/is checks come from, because everything is on the same screen. `USELESS_CAST` disappeared from `FirPsiJsOldFrontendDiagnosticsTestGenerated.testDynamicCastTarget` because `LanguageFeature.EnableDfaWarningsInK2` is disabled, and previously it only affected `FirCastOperatorsChecker`, but not `FirUselessTypeOperationCallChecker`, which felt like an unintended mistake. A related issue: KT-50965
This commit is contained in:
committed by
Space Team
parent
116ff60325
commit
92d8da621e
+4
-4
@@ -1,11 +1,11 @@
|
||||
// !DIAGNOSTICS: -REDUNDANT_NULLABLE
|
||||
|
||||
fun test(d: Any, dl: Collection<dynamic>) {
|
||||
d <!USELESS_CAST!>as <!DYNAMIC_NOT_ALLOWED!>dynamic<!><!>
|
||||
d <!USELESS_CAST!>as <!DYNAMIC_NOT_ALLOWED!>dynamic?<!><!>
|
||||
d as <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d as <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
d <!USELESS_CAST!>as? <!DYNAMIC_NOT_ALLOWED!>dynamic<!><!>
|
||||
d <!USELESS_CAST!>as? <!DYNAMIC_NOT_ALLOWED!>dynamic?<!><!>
|
||||
d as? <!DYNAMIC_NOT_ALLOWED!>dynamic<!>
|
||||
d as? <!DYNAMIC_NOT_ALLOWED!>dynamic?<!>
|
||||
|
||||
<!USELESS_IS_CHECK!>d is <!DYNAMIC_NOT_ALLOWED!>dynamic<!><!>
|
||||
<!USELESS_IS_CHECK!>d is <!DYNAMIC_NOT_ALLOWED!>dynamic?<!><!>
|
||||
|
||||
Reference in New Issue
Block a user