You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any access to the Dispatchers object breaks tests. This happens if we create a CoroutineScope without giving it a DispatcherProvider, or if we hard-code stuff like this:
classSomeClass {
// We can still use `.dispatcherProvider` with this coroutineScope,// but it always returns a default implementationval coroutineScope =CoroutineScope(Job() +Dispatchers.Main)
// This obviously accesses a hard-coded dispatcherfunfoo() = coroutineScope.launch(Dispatchers.Default) { ... }
}
This is relatively easy to catch with Lint rules, but adding that rule to the main artifact will immediately create a warning for any code which has not been refactored.
Open Items
Should a Lint rule go into its own artifact, effectively allowing the user to opt in by adding the dependency? Or should it just be published as part of the core artifact?
The text was updated successfully, but these errors were encountered:
Any access to the
Dispatchers
object breaks tests. This happens if we create aCoroutineScope
without giving it aDispatcherProvider
, or if we hard-code stuff like this:This is relatively easy to catch with Lint rules, but adding that rule to the main artifact will immediately create a warning for any code which has not been refactored.
Open Items
The text was updated successfully, but these errors were encountered: