bineanzhou / google-guice

Automatically exported from code.google.com/p/google-guice
Apache License 2.0
0 stars 0 forks source link

Guice + Wildcard types for Providers would be handy #207

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
From zorzella --

Suppose you're in this situation - Guice doesn't like the wildcard, but you 
can't pass a 
Provider<Bar> to Ifc.a().
  public interface Ifc {
    @Inject void a(Provider<? extends Foo> fooProvider);
  }

  interface Foo {}
  interface Bar extends Foo {}

  public void test() {
    Provider<Bar> barProvider = Providers.<Bar>of(new Bar() {});
    Ifc ifc = ...;
    ifc.a(barProvider); // requires wildcard
  }

Original issue reported on code.google.com by limpbizkit on 10 Jun 2008 at 8:39

GoogleCodeExporter commented 9 years ago
Wildcard bindings are supported as of r595:
http://code.google.com/p/google-guice/source/detail?r=595

Original comment by limpbizkit on 9 Aug 2008 at 10:51