blob: 19582884a8e1ec504d09cefda2b6efdb165cbdfd [file]
Resolve target: value-parameter x: kotlin.Any? smart-cast to kotlin.String
----------------------------------------------
// COMPILER_ARGUMENTS: -XXLanguage:+AllowContractsForCustomFunctions -XXLanguage:+UseReturnsEffect
package test
import kotlin.contracts.*
@OptIn(ExperimentalContracts::class)
fun myRequire(x: Boolean) {
contract {
returns() implies x
}
}
fun testContractFromSource(x: Any?, y: Any?) {
myRequire(x is String)
/* STATEMENT DELETED: myRequire(y is String) */
<caret>x.length
/* STATEMENT DELETED: myRequire(x is Int) */
}