| 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) */ |
| } |