[FIR] Move FirReturnsImpliesAnalyzer to the extended checkers
This commit is contained in:
committed by
Space Team
parent
db720d375d
commit
884cd6c754
Vendored
+1
-1
@@ -17,7 +17,7 @@ open class Foo {
|
||||
}
|
||||
|
||||
inline fun <reified T> assertIs(value: Any) {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract { returns() implies (value is T) }<!>
|
||||
contract { returns() implies (value is T) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -31,9 +31,9 @@ fun testNullWhenNull(x: Int?) {
|
||||
|
||||
// NB. it is the same function as `nullWhenNull`, but annotations specifies other facet of the function behaviour
|
||||
fun notNullWhenNotNull (x: Int?): Int? {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
contract {
|
||||
returns(null) implies (x == null)
|
||||
}<!>
|
||||
}
|
||||
return x?.inc()
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
import kotlin.contracts.*
|
||||
|
||||
fun safeIsString(x: Any?): Boolean? {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
contract {
|
||||
returns(true) implies (x is String)
|
||||
}<!>
|
||||
}
|
||||
return x?.let { it is String }
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -5,9 +5,9 @@
|
||||
import kotlin.contracts.*
|
||||
|
||||
fun safeIsString(x: Any?): Boolean? {
|
||||
<!WRONG_IMPLIES_CONDITION!>contract {
|
||||
contract {
|
||||
returns(true) implies (x is String)
|
||||
}<!>
|
||||
}
|
||||
return x?.let { it is String }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user