fmgasparino / google-gin

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

Ambiguous error message when attempting to implicitly bind an annotated value #120

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Create a class with an injected constructor that has annotated parameters.  
e.g.,

@Inject MyClass(@Annotation String value) {
}

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

The error states "No implementation bound for key".  This can be confusing, 
since it's not clear that the reason for the failure is the annotation.  I 
suggest something like "Cannot implicitly bind annotated types" instead.

Original issue reported on code.google.com by dburr...@google.com on 16 Oct 2010 at 12:00

GoogleCodeExporter commented 9 years ago
Here's one possible patch to improve the error message.

Original comment by dburr...@google.com on 16 Oct 2010 at 12:19

Attachments:

GoogleCodeExporter commented 9 years ago
Is this covered by the recently fixed issue #122 (source context for double 
bindings)? If not, would you mind uploading your patch to 
codereview.appspot.com so I can easier take a look and give feedback? Thanks!

Original comment by aragos on 3 Nov 2010 at 5:11

GoogleCodeExporter commented 9 years ago
Sure, here you go:

http://codereview.appspot.com/2863041

I created this issue before I figured out how to upload patches to codereview, 
sorry about that!

Original comment by dburr...@google.com on 3 Nov 2010 at 5:34

GoogleCodeExporter commented 9 years ago
Thanks! Committed in r152.

Original comment by aragos on 3 Nov 2010 at 6:05