<@U092308M7> here is what I came up with: ``` fun ...
# coroutines
p
@orangy here is what I came up with:
Copy code
fun <T> runSync(block: suspend () -> T): T {
  val result = block.startCoroutineOrReturn(NoopContinuation)
  if (result == SUSPENDED_MARKER) {
    throw IllegalStateException("function passed to runSync suspended")
  }
  @Suppress("UNCHECKED_CAST")
  return result as T
}