xiaodududu / google-guice

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

toProvider is not working in guice3.0 anymore #620

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago

in a module i have :

bind(Pf.class).toProvider(ProviderPf.class);

and
public class ProviderPf implements Provider<Pf> {

    public Pf get() {
      .....
     }
}

It worked with guice2.0 but it gives an error in 3.0:

Bound mismatch: The generic method toProvider(Class<I>) of type 
GinLinkedBindingBuilder<T> is not applicable for the arguments 
 (Class<ProviderPf>). The inferred type ProviderPf is not a valid substitute for the bounded parameter <I extends Provider<? extends Pf>>

Original issue reported on code.google.com by rvan...@casema.nl on 25 Mar 2011 at 6:02

GoogleCodeExporter commented 9 years ago
This looks like a problem with Gin, not Guice.  Are you using the latest 
version of Gin?  Consider filing a bug on Gin's site.

Original comment by sberlin on 25 Mar 2011 at 6:12

GoogleCodeExporter commented 9 years ago
Thanx : the use of gin1.5 in combination with guice3.0 solved it.

Original comment by rvan...@casema.nl on 25 Mar 2011 at 7:43