/**
* Unscoped bindings should not conflict, whether they were bound with no explicit scope, or
* explicitly bound in {@link Scopes#NO_SCOPE}.
*/
public void testDuplicateUnscopedBindings() {
Module singleBinding = new AbstractModule() {
@Override protected void configure() {
bind(Integer.class).to(Key.get(Integer.class, named("A")));
bind(Integer.class).to(Key.get(Integer.class, named("A"))).in(Scopes.NO_SCOPE);
}
@Provides @Named("A")
int provideInteger() {
return 5;
}
};
Module multibinding = new AbstractModule() {
@Override protected void configure() {
Multibinder<Integer> multibinder = Multibinder.newSetBinder(binder(), Integer.class);
multibinder.addBinding().to(Key.get(Integer.class, named("A")));
multibinder.addBinding().to(Key.get(Integer.class, named("A"))).in(Scopes.NO_SCOPE);
}