1 package kotlinx.coroutines.test.internal
2 import kotlinx.coroutines.*
3 
4 @Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") // do not remove the INVISIBLE_REFERENCE suppression: required in K2
getTestMainDispatchernull5 internal actual fun Dispatchers.getTestMainDispatcher(): TestMainDispatcher =
6     when (val mainDispatcher = Main) {
7         is TestMainDispatcher -> mainDispatcher
8         else -> TestMainDispatcher(mainDispatcher).also { injectMain(it) }
9     }
10