Is there a way to see the parts of context receivers that are currently available? The closest thing to docs i know of is the KEEP which is more of a proposal than up to date docs. the main difference im seeing is not having the
context(...){ }
scoping function to provide multiple values to the implicit context for calling functions with context params. Is this planned for a future release or has the implementation and plans just diverged from the original KEEP?
✅ 1
y
Youssef Shoaib [MOD]
04/18/2025, 6:20 PM
Those functions should eventually be added to stdlib, but in the meantime you can define them yourself:
Copy code
inline fun <A, B, R> context(a: A, b: B, block: context(A, B) () -> R {
contract {
callsInPlace(block, EXACTLY_ONCE)
}
return block(a, b)
}