Add test on isNullOrEmpty-like contract
Currently, behavior is undesired, see KT-27241
This commit is contained in:
+11
@@ -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
|
||||
}
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
public fun myIf(/*0*/ cond: kotlin.Boolean): kotlin.Any
|
||||
public fun test(/*0*/ x: kotlin.Any?): kotlin.Unit
|
||||
Reference in New Issue
Block a user