title: Kotlin coroutines not running launch on main
body: <p>I have following code:</p>
  <pre><code> Timber.d(&quot;Calling coroutine from thread: ${Thread.currentThread().name}&quot;)
      scope.launch {
          Timber.d(&quot;Current thread: ${Thread.currentThread().name}&quot;)
          runTest()
      }
  
   suspend fun runTest() {
      coroutineScope {
          launch(Dispatchers.Main) {
              Timber.d(&quot;Running from thread: ${Thread.currentThread().name}&quot;)
          }
      }
  }
  </code></pre>
  <p>If I run it. App crashes with no error in log.
  In my log I see:</p>
  <blockquote>
  <p>Calling coroutine from thread: main</p>
  <p>Current thread: DefaultDispatcher-worker-2</p>
  </blockquote>
  <p>But I don't see entry with <strong>Running from thread:</strong></p>
  <p>This is done in viewmodel
  My scope looks like this:</p>
  <pre><code>val scope: ViewModelCoroutineScope = ViewModelCoroutineScope(Dispatchers.Default)
  
  class ViewModelCoroutineScope(
      context: CoroutineContext
  ) : CoroutineScope {
  
      private var onViewDetachJob = Job()
      override val coroutineContext: CoroutineContext = context + onViewDetachJob
  
      fun onCleared() {
          onViewDetachJob.cancel()
      }
  }
  </code></pre>
  <p>What am I doing wrong?</p>