Open GoogleCodeExporter opened 9 years ago
Use a separate bind(B.class).in(Singleton.class) to make this work. What is
happening is that you're making linked binding a singleton, but not the
underlying binding a singleton.
The same thing would happen if you did:
bind(Foo.class).to(FooImpl.class).in(Singleton.class);
and then tried to compare injecting Foo vs injecting FooImpl. Injecting Foo
multiple times would be the same, but it'd be a different instance than
FooImpl, because "Foo" is the singleton, not "FooImpl".
Original comment by sberlin
on 11 Dec 2013 at 6:15
(would be good if gissuebot would link to migrated issues - e.g
https://github.com/google/guice/issues/791 )
Original comment by joseph.g...@gmail.com
on 2 Mar 2015 at 10:01
Original issue reported on code.google.com by
nachtr...@gmail.com
on 11 Dec 2013 at 6:10Attachments: