Issue 270: Just-in-time bindings for TypeLiteral<T> to undo erasure
http://code.google.com/p/google-guice/issues/detail?id=270

New issue report by limpbizkit:
Suppose we supported just-in-time bindings for instances of TypeLiteral:
    @Inject TypeLiteral<String> stringType;
    @Inject List<Map<Integer, Short>> listOfMapType;
In this case, we'd inject the TypeLiteral.get(String.class) and
TypeLiteral.get(Types.mapOf(Integer.class, String.class)) respectively.  
This requires a special case
for injecting TypeLiterals. It gets interesting is when we combine this  
type parameter matching.
Consider:
   class Foo<T> {
     @Inject TypeLiteral<T> myTypeParameter;
     @Inject TypeLiteral<Foo<T>> myRuntimeType;
   }
For example, if I had a Foo<String>, my injected type parameter would be a
TypeLiteral<String>. A nice value add, without much complexity.




Issue attributes:
        Status: Accepted
        Owner: limpbizkit

-- 
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to