Allow contracts on final non-override members since 1.4

This commit is contained in:
Dmitriy Novozhilov
2019-12-26 11:53:27 +03:00
parent 5a9070b6da
commit f083edfac2
34 changed files with 682 additions and 45 deletions
@@ -0,0 +1,19 @@
// !LANGUAGE: +AllowContractsForCustomFunctions +ReadDeserializedContracts +AllowContractsForNonOverridableMembers
// !USE_EXPERIMENTAL: kotlin.contracts.ExperimentalContracts
@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
package test
import kotlin.contracts.*
class Foo {
fun <X, Y, Z, R> callsEffectWithKind(block: (X, Y, Z) -> R) {
contract {
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
}
fun returnsImplies(x: Boolean) {
contract { returns() implies (x) }
}
}