[FE 1.0] Report USELESS_IS_CHECK if is expression is always false
^KT-47684 Fixed
This commit is contained in:
committed by
teamcityserver
parent
785e2f862c
commit
7b5a5f5682
+2
-2
@@ -78,7 +78,7 @@ fun branchedAndNested(x: Any?, y: Any?) {
|
||||
|
||||
|
||||
fun br(y: Any?) {
|
||||
if (myAssert(y is Int) == Unit && myAssert(y is String) == Unit) {
|
||||
if (myAssert(y is Int) == Unit && myAssert(<!USELESS_IS_CHECK!>y is String<!>) == Unit) {
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.inc()
|
||||
}
|
||||
@@ -89,7 +89,7 @@ fun branchedAndNestedWithNativeOperators(x: Any?, y: Any?) {
|
||||
equalsTrue(notEqualsNull(nullWhenNotString(x))) // x is String
|
||||
&&
|
||||
(
|
||||
(myAssert(y is Int) == Unit && myAssert(y is String) == Unit) // y is Int, String
|
||||
(myAssert(y is Int) == Unit && myAssert(<!USELESS_IS_CHECK!>y is String<!>) == Unit) // y is Int, String
|
||||
||
|
||||
equalsTrue(isInt(y) && isString(y)) // y is Int, String
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user