@Component
public interface MyComponent {
MySubcomponent.MySubcomponentBuilder mySubcomponentBuider();
}
@Subcomponent
public interface MySubcomponent {
@Subcomponent.Builder
interface MySubcomponentBuilder {
@BindsInstance
MySubcomponentBuilder integer(Integer integer);
MySubcomponent build();
}
void inject(B b);
}
public class A {
@Inject
public A(Integer integer) {
}
}
public class B {
@Inject
A a;
}
public class Main {
public static void main(String[] args) {
DaggerMyComponent.create().mySubcomponentBuider().integer(42).build().inject(new B());
}
}
This code produces next error:
error: cannot find symbol this.integerProvider = InstanceFactory.create(builder.integer);
Because it tries to get integer from the builder interface, not the implementation.
Code here
Ah, this is definitely a good edge case. We should fix this (though probably low priority)
Most helpful comment
Ah, this is definitely a good edge case. We should fix this (though probably low priority)