square / dagger

A fast dependency injector for Android and Java.

Home Page:https://square.github.io/dagger/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when a component is trying to include bindings with different scopes could be more informative

benkay opened this issue · comments

If a class included in a component with @scopea depends on a binding with @scopeB, then a compilation error is thrown

ComponentA scoped with @ScopeA may not reference bindings with different scopes:

    @ScopeB class a.b.ClassWithScopeB

This is useful in the case where ClassWithScopeB has the wrong scope annotation, but it gives no help in discovering the dependency chain which is causing ClassWithScopeB to be included in ComponentA in the first place. In a large component graph this can be non-trivial

Derp. Filed this in the wrong dagger project 😳