dagger-reflect
dagger-reflect copied to clipboard
`@Provides` within a `companion object` not being injected
If I try to provide an object using the following code; Dagger works, but Reflect doesn't:
@Module
interface MyModule {
companion object {
@Provides
fun providesString(): String = "Hello"
}
}
Same is true if MyModule is a class or an abstract class.
Perhaps this is covered by what's described in this limitation? https://github.com/JakeWharton/dagger-reflect#abstract-classes
This seems related to https://github.com/JakeWharton/dagger-reflect/issues/185.
You can add @JvmStatic to providesString in the meanwhile for dagger reflect to work.
Looks like the same thing alright, thanks for the link and workaround.