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
In our application we have structure similar to this one:
@Singleton
@Component
interface MainComponent {
fun feature(): FeatureComponent
}
@Subcomponent
interface FeatureComponent {
fun plus(module: SubFeatureModuleA): SubFeatureComponentA
fun plus(module: SubFeatureModuleB): SubFeatureComponentB
}
@Scope
@Retention(RUNTIME)
annotation class SubFeatureScopeA
@Module
class SubFeatureScopeA {
@Provides
@SubFeatureScopeA
fun provideSomething(something: Something): ISomething = something
}
@Subcomponent(modules = [SubFeatureModuleA::class])
@SubFeatureScopeA
interface SubFeatureComponentA {
fun inject(fragment: SubFeatureAFragment)
}
(sometimes also FeatureComponent has some modules defined, but it's irrelevant in this case)
For such case, we get following exception in runtime:
Caused by: java.lang.IllegalStateException: Scope with annotations [@com.myapp.SubFeatureScopeA()] may not depend on unscoped
at dagger.reflect.Scope$Builder.<init>(Scope.java:167)
at dagger.reflect.ComponentScopeBuilder.get(ComponentScopeBuilder.java:115)
at dagger.reflect.ComponentInvocationHandler$SubcomponentMethodInvocationHandler.invoke(ComponentInvocationHandler.java:180)
at dagger.reflect.ComponentInvocationHandler.invoke(ComponentInvocationHandler.java:70)
at java.lang.reflect.Proxy.invoke(Proxy.java:913)
at $Proxy44.plus(Unknown Source)
while the dagger-compiler (2.26) allows such construct and works fine.
The text was updated successfully, but these errors were encountered:
In our application we have structure similar to this one:
(sometimes also FeatureComponent has some modules defined, but it's irrelevant in this case)
For such case, we get following exception in runtime:
while the dagger-compiler (2.26) allows such construct and works fine.
The text was updated successfully, but these errors were encountered: