@dagger.Module
public abstract static class Module {
@NonNull
@OnlineScope
@Provides
static A a() {
return new A();
}
}
@NonNull
@OnlineScope
@Provides
B b() {
return new B();
}
}
Oops! We forgot to add static to the second provider. This example now crashes at runtime.
If you forget to add static to an abstract module your app will crash at runtime. This should be prevented at compile time.
Example: Suppose you have a nice abstract module such as the following example:
Next, lets add a new provider to the Module.
Oops! We forgot to add
static
to the second provider. This example now crashes at runtime.