with

inline fun <A, B, R> with(a: A, b: B, block: context(A, B) () -> R): R

Generic two-receiver variant of with: executes block with both a and b available as Kotlin context receivers. Unlike a vararg version, the two type parameters keep a and b's distinct types, so each can satisfy a separate context(...) parameter (a vararg would collapse them to their common supertype). For more receivers, add further fixed-arity overloads.