Detect redundant 'is' check
#KT-14187 Fixed
This commit is contained in:
committed by
Mikhail Zarechenskiy
parent
768e0fa738
commit
cd24adac32
@@ -9,7 +9,7 @@ sealed class Expr : Stmt() {
|
||||
fun test(x: Stmt): String =
|
||||
when (x) {
|
||||
is Expr -> "expr"
|
||||
is Stmt -> "stmt"
|
||||
<!USELESS_IS_CHECK!>is Stmt<!> -> "stmt"
|
||||
}
|
||||
|
||||
fun test2(x: Stmt): String =
|
||||
@@ -19,5 +19,5 @@ fun test2(x: Stmt): String =
|
||||
|
||||
fun test3(x: Expr): String =
|
||||
when (x) {
|
||||
is Stmt -> "stmt"
|
||||
<!USELESS_IS_CHECK!>is Stmt<!> -> "stmt"
|
||||
}
|
||||
@@ -9,7 +9,7 @@ sealed class Sealed {
|
||||
fun foo(s: Sealed): Int {
|
||||
return <!NO_ELSE_IN_WHEN!>when<!>(s) {
|
||||
is Sealed.First -> 1
|
||||
!is Any -> 0
|
||||
<!USELESS_IS_CHECK!>!is Any<!> -> 0
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user