Add test on isNullOrEmpty-like contract

Currently, behavior is undesired, see KT-27241
This commit is contained in:
Dmitry Savvinov
2018-10-17 15:09:05 +03:00
parent 48d832298b
commit 04ff2a3ee7
4 changed files with 25 additions and 0 deletions
@@ -0,0 +1,11 @@
// !LANGUAGE: +AllowContractsForCustomFunctions +UseReturnsEffect
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
// !DIAGNOSTICS: -INVISIBLE_REFERENCE -INVISIBLE_MEMBER
import kotlin.contracts.*
fun f3(value: String?) {
if (<!USELESS_IS_CHECK!>!value.isNullOrEmpty() is Boolean<!>) {
<!DEBUG_INFO_SMARTCAST!>value<!>.length
}
}
@@ -0,0 +1,4 @@
package
public fun myIf(/*0*/ cond: kotlin.Boolean): kotlin.Any
public fun test(/*0*/ x: kotlin.Any?): kotlin.Unit