title: Guice, Injecting TypeLiteral<T> when using @AssistedInject
body: <p>This works: </p>
  
  <pre><code>public static class SomeGenericType&lt;T&gt; {
      private TypeLiteral&lt;T&gt; type; 
  
      @Inject
      public SomeGenericType(TypeLiteral&lt;T&gt; type) {
          this.type = type; 
      }
  
      public Class&lt;? super T&gt; getType() {
          return type.getRawType();
      }
  }
  </code></pre>
  
  <p>Guice automatically injects the TypeLiteral representing String when I do:</p>
  
  <pre><code>@Inject SomeGenericType&lt;String&gt; foo;
  </code></pre>
  
  <p>But when trying the same thing with Assisted Inject: </p>
  
  <pre><code>public static interface FooFactory&lt;T&gt; {
      Foo&lt;T&gt; create(String name);
  }
  
  public static class Foo&lt;T&gt; {
  
      @AssistedInject
      public Foo(TypeLiteral&lt;T&gt; type, @Assisted String name) {
          ....
  </code></pre>
  
  <p>My Module looking like this: </p>
  
  <pre><code>public static class TestMod extends AbstractModule {
      @Override
      protected void configure() {
          install(new FactoryModuleBuilder().build(new TypeLiteral&lt;FooFactory&lt;String&gt;&gt;(){}));
      }   
  }
  </code></pre>
  
  <p>I get an exception while installing the module: </p>
  
  <pre><code>TypeLiteral&lt;T&gt; cannot be used as a Key, it is not fully specified. 
  </code></pre>
  
  <p>It's certainly the TypeLiteral that I'm trying to Inject that is the problem, as the generic factory does work fine when I remove it. </p>
  
  <p>So, I'll probably just roll my own factory for the moment, but I'm curious to whether this should work? Is it a matter of using the FactoryModuleBuilder slightly differently? </p>