title: Dagger 2 component inheritance and errors
body: <p>I'm trying to create the following scenario:</p>
  
  <pre><code>public interface DaggerInjectionFactory {
      void inject(MyActivity myActivity);
  }
  
  @Singleton
  @Component(modules = {RestModule.class})
  public interface MyRestComponent extends DaggerInjectionFactory {
      RestClient provideRestClient();
  }
  
  @Singleton
  @Component(modules = {PreferencesModule.class})
  public interface MyPreferencesComponent extends DaggerInjectionFactory {
      SharedPreferences provideSharedPreferences();       
  }
  </code></pre>
  
  <p>The dagger compiler gives me the following error as a response:</p>
  
  <pre><code>error: RestClient cannot be provided without an @Provides- or @Produces-annotated method.
  </code></pre>
  
  <p>The <code>RestModule</code> contains a <code>@Provides @Singleton RestClient provideRestClient()</code> method and it is also worth noting that when I remove the <code>extends DaggerInjectionFactory</code> from the <code>MyPreferencesComponent</code> the dagger compiler has no issue in generating the component builders.</p>
  
  <p>What I'm trying to do is create an interface with all the injectable classes, in which I want to use the <code>@Inject</code> annotation, and implement them in 'all' of my components so I don't have to add the <code>void inject(MyActivity myActivity);</code> to all of my components.</p>
  
  <p>Because I'm new to the framework I have no idea what the correct terminology is and therefore have no real clue as to what I need to search for.</p>
  
  <p>So my questions are: is it possible to create such a structure, to define an interface which automatically adds all the <code>void inject()</code> methods to 'all' of my components? and if so, how can it be done?</p>
  
  <p>-- Edit --
  The expected usage would be something like:</p>
  
  <pre><code>public MyActivity extends Activity {
      private RestClient restClient;
      private SharedPreferences sharedPreferences;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          MyRestComponent.Instance.build().inject(this);
          MyPreferencesComponent.Instance.build().inject(this);
      }
  
      @Inject
      public void setRestClient(RestClient restClient){
          this.restClient = restClient;
      }
  
      @Inject
      public void setSharedPreferences(SharedPreferences sharedPreferences){
          this.sharedPreferences = sharedPreferences;
      }
  }
  </code></pre>