FIR: apply minor test data fixes around type mismatch problems

This commit is contained in:
Mikhail Glukhikh
2021-04-13 13:57:45 +03:00
parent 9accd8c9ad
commit 78fc87ffb1
6 changed files with 10 additions and 8 deletions
@@ -1,5 +1,5 @@
FILE: eqNotEq.kt
public final fun checkNotNull(x: R|kotlin/Any?|): R|kotlin/Unit|
public final fun checkNotNull(x: R|kotlin/Any?|): R|kotlin/Boolean|
[R|Contract description]
<
Returns(TRUE) -> x != null
@@ -1,11 +1,11 @@
import kotlin.contracts.*
fun checkNotNull(x: Any?) {
fun checkNotNull(x: Any?): Boolean {
contract {
returns(true) implies (x != null)
returns(false) implies (x == null)
}
return <!RETURN_TYPE_MISMATCH!>x != null<!>
return x != null
}
fun trickyRequireNotNull(x: Any?) {
@@ -1,5 +1,5 @@
FILE: typePredicate.kt
public final fun checkIsString(x: R|kotlin/Any|): R|kotlin/Unit|
public final fun checkIsString(x: R|kotlin/Any|): R|kotlin/Boolean|
[R|Contract description]
<
Returns(TRUE) -> x is kotlin/String
@@ -1,11 +1,11 @@
import kotlin.contracts.*
fun checkIsString(x: Any) {
fun checkIsString(x: Any): Boolean {
contract {
returns(true) implies (x is String)
returns(false) implies (x !is String)
}
return <!RETURN_TYPE_MISMATCH!>x is String<!>
return x is String
}
fun test(x: Any) {