https://kotlinlang.org logo
Title
g

groostav

11/02/2018, 5:12 AM
doing some testing, that code works as written, the
this: CoroutineScope
provided by
runblocking
is captured by the closure in
someOtherMethod
, so that code, as you've written it, compiles just fine for me.
you might also try labelling it: at the very least you can use a
this@runBlocking
, or alternativel you can name it with a label
fun foo() = runBlocking myScope@ {
  someOtherMethod {
    this@myScope.async { //...|
    }
  }
}
i

ibash

11/04/2018, 11:31 PM
Maybe I was doing something weird, was using the experimental coroutines package