Matt Nelson
10/11/2025, 5:55 PMcontract defined, and another inline function points to it, do I also have to specify the contract in that inline function?
E.g. Does foo also need the contract defined?
public inline fun foo(block: () -> Unit): Boolean = bar(block)
@OptIn(ExperimentalContracts::class)
public inline fun bar(block: () -> Unit): Boolean {
contract { callsInPlace(block, InvocationKind.AT_MOST_ONCE) }
// ...
}Dan Rusu
10/11/2025, 6:36 PMMatt Nelson
10/11/2025, 6:39 PM