[FIR] Use Function<R> as super type for all FunctionNtypes

This commit is contained in:
Dmitriy Novozhilov
2020-01-24 11:35:37 +03:00
parent 099d737e86
commit 7d8363d6aa
37 changed files with 57 additions and 47 deletions
@@ -6,7 +6,7 @@ import kotlin.contracts.*
fun <T> runTwice(block: () -> T): T {
contract {
<!INAPPLICABLE_CANDIDATE!>callsInPlace<!>(block, InvocationKind.AT_LEAST_ONCE)
callsInPlace(block, InvocationKind.AT_LEAST_ONCE)
}
block()
return block();
@@ -14,7 +14,7 @@ fun <T> runTwice(block: () -> T): T {
fun <T> runOnce(block: () -> T): T {
contract {
<!INAPPLICABLE_CANDIDATE!>callsInPlace<!>(block, InvocationKind.EXACTLY_ONCE)
callsInPlace(block, InvocationKind.EXACTLY_ONCE)
}
return block();
};
@@ -6,7 +6,7 @@ import kotlin.contracts.*
fun <T> runTwice(block: () -> T): T {
contract {
<!INAPPLICABLE_CANDIDATE!>callsInPlace<!>(block, InvocationKind.AT_LEAST_ONCE)
callsInPlace(block, InvocationKind.AT_LEAST_ONCE)
}
block()
return block();
@@ -6,7 +6,7 @@ import kotlin.contracts.*
fun <T> runTwice(block: () -> T): T {
contract {
<!INAPPLICABLE_CANDIDATE!>callsInPlace<!>(block, InvocationKind.AT_LEAST_ONCE)
callsInPlace(block, InvocationKind.AT_LEAST_ONCE)
}
block()
return block();