Open GoogleCodeExporter opened 9 years ago
Original comment by limpbizkit
on 26 Apr 2009 at 9:31
I believe the original issue is fixed with the new FactoryModuleBuilder way of
using
AssistedInject. using install(new FactoryModuleBuilder().build(Factory.class));
where Factory's return type isn't bound produces an error message that says, "No
implementation for MyReturnType was bound.". If you do something like new
FactoryModuleBuilder().implement(Foo.class,
FooImpl.class).build(BazFactory.class);,
then you'll still get the 'No Baz was bound' (if Baz is an interface) error,
and the
Foo/FooImpl part is just ignored.
But -- there's still some misleading errors if Factory is genericized(for
example,
Foo.Factory<E> creates Foo<E>). If the factory is generic & is bound using
build(Factory.class) instead of new TypeLiteral<Factory<String>>(){}, this is
the
error message:
com.google.inject.CreationException: Guice creation errors:
1) com.google.inject.assistedinject.FactoryModuleBuilderTest$Foo<E> cannot be
used as
a key; It is not fully specified.
2) No implementation for
com.google.inject.assistedinject.FactoryModuleBuilderTest$Foo$Factory was bound.
Original comment by sberlin
on 23 May 2010 at 12:54
fixed in r1165
Original comment by sberlin
on 23 May 2010 at 1:40
Original issue reported on code.google.com by
gili.tza...@gmail.com
on 9 Feb 2009 at 1:14