Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Dispatchers.Main not being fully initialized on Android and Swing (…
…Kotlin#3101) * Fix Dispatchers.Main not being fully initialized on Android If `unitTests.returnDefaultValues=true` is set, then `Looper.getMainLooper()` may return `null`. The type system of Kotlin is tricked to believe that the method can't ever return `null`, so doesn't check for it anywhere. As a result, despite not being fully initialized, `Dispatchers.Main` is considered correct. This was not an issue before, as it only surfaced when `Dispatchers.Main` was used. However, now, `Main` is the source of time for delays, so any delay will throw something incomprehensible if this happens.
- Loading branch information