Bug 495499

Summary: InjectorFactory should throw an error when the binding being added isn't of the correct type
Product: [Eclipse Project] Platform Reporter: Alex Blewitt <alex.blewitt>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3    
Version: 4.6   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Alex Blewitt CLA 2016-06-05 18:21:54 EDT
I discovered an error in my code when using:

 InjectorFactory.getDefault().
     addBinding(IStringService.class).
      implementedBy(StringService.class);

I had forgotten to add 'class StringService implements IStringService' and so the binding was never going to work. However, I would have expected this to be a compile-time error (assuming that the addBinding was generic) or at the very least a runtime error. However all errors were invisibly swallowed, even though it would never be able to be injected if this were the case.

It would be better if the above could be a runtime or compile time error, which would have identified the problem (for me) much faster.