mehdikwa / google-gin

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

When a double binding involving a child module is encountered, Gin reports only one of the bindings. #161

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create an injector with a parent and a child module
2. Bind the same key in the parent module and the child module; don't expose it.

What is the expected output? What do you see instead?

Both bindings should be displayed when the double-binding is encountered.  
Instead, Gin suggests that you should expose the child's binding, but doesn't 
tell you which child it's bound in.  Also, the error pointed me at a binding, 
not an injection point.

"Error injecting <type>: already bound in child Ginjector.  Consider exposing 
it?

<path to parent binding>"

It should say something like:
"Double binding: <type> is bound in both a parent and a child module.  Consider 
exposing it?

Parent module "parent module name":

<path to parent binding>

Child module "child module name":

<path to child binding>

Original issue reported on code.google.com by dburr...@google.com on 24 Jun 2011 at 6:35

GoogleCodeExporter commented 9 years ago
Started a fix for this in this patch for review: 
http://codereview.appspot.com/4967042/

Original comment by aragos on 26 Aug 2011 at 5:29

GoogleCodeExporter commented 9 years ago
Mostly fixed in r226. Please comment if you need even more specific error 
reporting.

Original comment by aragos on 16 Sep 2011 at 3:37