21 lines
441 B
Kotlin
Vendored
21 lines
441 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
// !OPT_IN: kotlin.contracts.ExperimentalContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.contracts.*
|
|
|
|
fun foo(x: Any?): Boolean {
|
|
contract {
|
|
returns() implies (x is String)
|
|
}
|
|
return bar(x)
|
|
}
|
|
|
|
fun bar(x: Any?): Boolean {
|
|
contract {
|
|
returns() implies (x is Int)
|
|
}
|
|
return foo(x)
|
|
} |