mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
- Add ContractDescriptorRenderer - Add option to dump function contracts in DescriptorRendererOptions - Add parsing of LANGUAGE_VERSION directive in AbstractLoadJava - Add tests on serialization-deserializaton identity of contracts ========== Introduction of EffectSystem: 13/18
22 lines
414 B
Kotlin
Vendored
22 lines
414 B
Kotlin
Vendored
// LANGUAGE_VERSION: 1.3
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.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))
|
|
}
|
|
} |