Minor, remove obsolete directives and suppressions from contracts test data
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@ExperimentalContracts
|
||||
fun runOnce(action: () -> Unit) {
|
||||
contract {
|
||||
callsInPlace(action, InvocationKind.EXACTLY_ONCE)
|
||||
@@ -12,7 +10,6 @@ fun runOnce(action: () -> Unit) {
|
||||
action()
|
||||
}
|
||||
|
||||
@ExperimentalContracts
|
||||
class Foo(foo: Boolean) {
|
||||
var res = "FAIL"
|
||||
init {
|
||||
@@ -23,8 +20,7 @@ class Foo(foo: Boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalContracts
|
||||
fun box(): String {
|
||||
val foo = Foo(true)
|
||||
return foo.res
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public fun myrun(block: () -> Unit) {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
-2
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
-2
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
+3
-13
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
-2
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
@@ -9,7 +8,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun myrun(crossinline block: () -> Unit): Unit {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// FILE: 1.kt
|
||||
@@ -6,7 +5,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@ExperimentalContracts
|
||||
class A {
|
||||
var res = "FAIL"
|
||||
|
||||
@@ -23,7 +21,6 @@ class A {
|
||||
}
|
||||
}
|
||||
|
||||
@ExperimentalContracts
|
||||
inline fun baz(crossinline exactly_once: () -> Unit) {
|
||||
contract {
|
||||
callsInPlace(exactly_once, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
@@ -9,7 +8,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun myrun(noinline block: () -> Unit): Unit {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
// WITH_RUNTIME
|
||||
@@ -10,7 +9,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// IGNORE_BACKEND: JVM_IR, JS_IR, NATIVE
|
||||
// IGNORE_BACKEND_MULTI_MODULE: JVM_IR
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
@@ -32,4 +30,4 @@ class A {
|
||||
|
||||
fun box(): String {
|
||||
return A().z
|
||||
}
|
||||
}
|
||||
|
||||
-2
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +AllowContractsForCustomFunctions +UseCallsInPlaceEffect +ReadDeserializedContracts
|
||||
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
@@ -8,7 +7,6 @@ package test
|
||||
|
||||
import kotlin.contracts.*
|
||||
|
||||
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
|
||||
public inline fun <R> myrun(block: () -> R): R {
|
||||
contract {
|
||||
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
|
||||
|
||||
Reference in New Issue
Block a user