Is there a way to ensure that a multibound type us...
# dagger
k
Is there a way to ensure that a multibound type uses a specific scope and qualifier? That is, if I have
@Multibinds @Singleton @MyQualifier Set<Foo>
, how could I make sure there isn't a binding that's accidentally unqualified or
@ActivityScoped
, and thus be missing from the
@Singleton @MyQualifier
Set I'd be injecting?
a
You could use Dagger SPI to build validations for this. I wrote about this here. https://arunkumar.dev/dagger-spi-building-custom-validations-for-dependency-graphs/