mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 15:53:19 +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
24 lines
545 B
Kotlin
Vendored
24 lines
545 B
Kotlin
Vendored
// LANGUAGE_VERSION: 1.3
|
|
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
|
|
|
package test
|
|
|
|
import kotlin.internal.contracts.*
|
|
|
|
fun <X, Y, Z, R> callsEffectWithKind(block: (X, Y, Z) -> R) {
|
|
contract {
|
|
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
|
}
|
|
}
|
|
|
|
inline fun callsEffectImplicitUnknown(x: Int, y: Int, block: () -> Unit) {
|
|
contract {
|
|
callsInPlace(block)
|
|
}
|
|
}
|
|
|
|
inline fun callsEffectExplicitUnknown(x: Int, block: () -> Unit) {
|
|
contract {
|
|
callsInPlace(block, InvocationKind.UNKNOWN)
|
|
}
|
|
} |