Minor, remove obsolete directives and suppressions from contracts test data

This commit is contained in:
Alexander Udalov
2019-11-05 16:01:46 +01:00
parent 66e19b13ce
commit 4164b620e8
17 changed files with 8 additions and 53 deletions
@@ -1,4 +1,3 @@
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
// IGNORE_BACKEND: NATIVE
// NO_CHECK_LAMBDA_INLINING
@@ -12,36 +11,27 @@ interface SomeOutputScreenCallbacks {
fun ontest()
}
@ExperimentalContracts
class OutputWorkScreenView(callbacks: SomeOutputScreenCallbacks) {
val root = vBox {
button(callbacks::ontest)
}
}
@ExperimentalContracts
inline fun vBox(
crossinline action: () -> Unit
) {
inline fun vBox(crossinline action: () -> Unit) {
contract {
callsInPlace(action, InvocationKind.EXACTLY_ONCE)
}
return { action() }()
}
@ExperimentalContracts
inline fun button(
onAction: () -> Unit
) {
inline fun button(onAction: () -> Unit) {
onAction()
}
// FILE: 2.kt
import test.*
import kotlin.contracts.*
@ExperimentalContracts
fun box(): String {
var res = "FAIL"
OutputWorkScreenView(object : SomeOutputScreenCallbacks {
@@ -50,4 +40,4 @@ fun box(): String {
}
})
return res
}
}