FIR checker: warn unnecessary non-null assertions

This commit is contained in:
Jinseong Jeon
2021-04-01 11:44:47 -07:00
committed by Mikhail Glukhikh
parent 5229d4e4f4
commit 2ecb6733ed
72 changed files with 268 additions and 246 deletions
@@ -388,49 +388,49 @@ fun poll66(): Flow<String> {
fun poll7(): Flow<String> {
return flow {
val inv = ::bar!!
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
}
}
fun poll71(): Flow<String> {
return flow {
val inv = ::bar2!!
val inv = ::bar2<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv()
}
}
fun poll72(): Flow<String> {
return flow {
val inv = ::bar3!!
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv()
}
}
fun poll73(): Flow<String> {
return flow {
val inv = ::bar4!!
val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll74(): Flow<String> {
return flow {
val inv = ::bar5!!
val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll75(): Flow<String> {
return flow {
val inv = ::Foo6!!
val inv = ::Foo6<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll76(): Flow<String> {
return flow {
val inv = ::Foo7!!
val inv = ::Foo7<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
@@ -36,21 +36,21 @@ class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
fun poll71(): Flow<String> {
return flow {
val inv = ::bar2!!
val inv = ::bar2<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv()
}
}
fun poll73(): Flow<String> {
return flow {
val inv = ::bar4!!
val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll75(): Flow<String> {
return flow {
val inv = ::Foo6!!
val inv = ::Foo6<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
@@ -37,49 +37,49 @@ class Flow<out R>(private val block: suspend FlowCollector<R>.() -> Unit)
fun poll7(): Flow<String> {
return flow {
val inv = ::bar!!
val inv = ::bar<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv(<!NO_VALUE_FOR_PARAMETER!>)<!>
}
}
fun poll71(): Flow<String> {
return flow {
val inv = ::bar2!!
val inv = ::bar2<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv()
}
}
fun poll72(): Flow<String> {
return flow {
val inv = ::bar3!!
val inv = ::bar3<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv()
}
}
fun poll73(): Flow<String> {
return flow {
val inv = ::bar4!!
val inv = ::bar4<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll74(): Flow<String> {
return flow {
val inv = ::bar5!!
val inv = ::bar5<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll75(): Flow<String> {
return flow {
val inv = ::Foo6!!
val inv = ::Foo6<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
fun poll76(): Flow<String> {
return flow {
val inv = ::Foo7!!
val inv = ::Foo7<!NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE!>!!<!>
inv
}
}
@@ -119,28 +119,28 @@ fun poll5(): Flow<String> {
fun poll7(): Flow<String> {
return flow {
val inv = {}!!
val inv = {}<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>
inv()
}
}
fun poll71(): Flow<String> {
return flow {
val inv = {1f}!!
val inv = {1f}<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>
inv()
}
}
fun poll72(): Flow<String> {
return flow {
val inv = {{}}!!
val inv = {{}}<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>
inv()
}
}
fun poll73(): Flow<String> {
return flow {
val inv = ({})!!
val inv = ({})<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>
inv
}
}
@@ -189,7 +189,7 @@ fun poll85(): Flow<String> {
fun poll86(): Flow<String> {
return flow {
val inv = {({"1"})}!! in setOf({({"1f"})}!!)
val inv = {({"1"})}<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!> in setOf({({"1f"})}<!NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION!>!!<!>)
<!UNRESOLVED_REFERENCE!>inv<!>()
}
}