Hi there, can any one explain, why the `delay(1000...
# coroutines
u
Hi there, can any one explain, why the
delay(1000)
is not canceled in this code:
Copy code
fun main() = runBlocking(Dispatchers.Default) {
    val viewModelScope = CoroutineScope(Dispatchers.Default)
    val appScope = CoroutineScope(Dispatchers.Default)
    viewModelScope.launch() {
        println("Coroutine launched in viewModelScope!")
        withContext(appScope.coroutineContext) {
            try {
	            println("Coroutine launched in appScope?")
    	        delay(1000)
        	    println("One second passed")
            } catch (c: CancellationException) {
                println("appScope canceled: c")
				throw c
            }
        }
    }
    delay(100)
	viewModelScope.cancel()
    println("viewModelScope canceled")
    delay(1500)
    println("Done")
}