title: Generic @Inject'd fields in an abstract superclass
body: <p>Consider a MVP-ish set of types. An abstract Presenter exists, with a View interface:</p>
  
  <pre><code>public interface View {
      //...
  }
  
  public abstract class AbstractPresenter&lt;V extends View&gt; {
      @Inject V view;
      //...
  }
  </code></pre>
  
  <p>Then, lets have a specific concrete presenter subclass, with its view interface and implementation:</p>
  
  <pre><code>public interface LoginView extends View {
      //...
  }
  public LoginPresenter extends AbstractPresenter&lt;LoginView&gt; {
      //...
  }
  
  public class LoginViewImpl implements LoginView {
      //...
  }
  </code></pre>
  
  <p>In a Dagger module, of course we would define a <code>@Provides</code> method:</p>
  
  <pre><code>@Provides
  LoginView provideLoginView() {
      return new LoginViewImpl();
  }
  </code></pre>
  
  <p>In Guice you could write this the same way, or just <code>bind(LoginView.class).to(LoginViewImpl.class)</code>.</p>
  
  <p>However, in Dagger (both v1 and the 2.0-SNAPSHOT from Google), this produces an error, since it can't figure out what <code>V</code> is when creating the binding wiring for <code>AbstractPresenter&lt;V&gt;</code>. On the other hand, Guice figures out that that because it is actually creating a <code>LoginPresenter</code>, so it needs an implementation of <code>LoginView</code>. </p>
  
  <p>Dagger 1.2.2:</p>
  
  <pre><code>foo.bar.AbstractPresenter$$InjectAdapter.java:[21,31] cannot find symbol
    symbol:   class V
    location: class foo.bar.AbstractPresenter$$InjectAdapter
  </code></pre>
  
  <p>Dagger 2.0-SNAPSHOT:</p>
  
  <pre><code>Caused by: java.lang.IllegalArgumentException: V
      at dagger.internal.codegen.writer.TypeNames$2.defaultAction(TypeNames.java:39)
      at dagger.internal.codegen.writer.TypeNames$2.defaultAction(TypeNames.java:36)
      at javax.lang.model.util.SimpleTypeVisitor6.visitTypeVariable(SimpleTypeVisitor6.java:179)
      at com.sun.tools.javac.code.Type$TypeVar.accept(Type.java:1052)
      at dagger.internal.codegen.writer.TypeNames.forTypeMirror(TypeNames.java:36)
      at dagger.internal.codegen.MembersInjectorGenerator.write(MembersInjectorGenerator.java:142)
      at dagger.internal.codegen.MembersInjectorGenerator.write(MembersInjectorGenerator.java:61)
      at dagger.internal.codegen.SourceFileGenerator.generate(SourceFileGenerator.java:53)
      at dagger.internal.codegen.InjectBindingRegistry.generateSourcesForRequiredBindings(InjectBindingRegistry.java:101)
      at dagger.internal.codegen.ComponentProcessor.process(ComponentProcessor.java:149)
  </code></pre>
  
  <p>My question: Is this a bug? Is this a missing feature? Or is this a performance issue that Dagger is protecting us from (a la SerializableTypeOracleBuilder in GWT RPC)?</p>
  
  <p>Note that this same issue occurs when <code>V</code> is referred to as <code>Provider&lt;V&gt;</code>, <code>Lazy&lt;V&gt;</code>, etc.</p>