23 lines
506 B
Kotlin
Vendored
23 lines
506 B
Kotlin
Vendored
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts
|
|
// !OPT_IN: kotlin.contracts.ExperimentalContracts
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.contracts.*
|
|
|
|
|
|
fun orSequence(x: Any?, y: Any?, b: Boolean) {
|
|
contract {
|
|
returns() implies (x is String || y is Int || !b)
|
|
}
|
|
}
|
|
|
|
class A
|
|
class B
|
|
|
|
fun andSequence(x: Any?, y: Any?, b:Boolean) {
|
|
contract {
|
|
returns() implies (x is A && x is B && ((y is A) && b))
|
|
}
|
|
} |