Joe
08/15/2022, 7:12 PMInjectDispatcher
rule, should the following violate it:
class MyRepository(val dispatcher: CoroutineDispatcher) {
@Inject // mark this constructor as the one used by guice at runtime, tests can still inject a TestDispatcher using the primary constructor
constructor() : this(<http://Dispatchers.IO|Dispatchers.IO>)
}
This is basically equivalent to class MyRepository(dispatcher: CoroutineDispatcher = <http://Dispatchers.IO|Dispatchers.IO>)
but still triggers the detekt rule. Or am I missing a difference?chao
08/15/2022, 7:13 PMJoe
08/15/2022, 7:21 PM