Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalArgumentException: No provider available for V when injecting a field in a generic subclass #168

Open
amatkovsky opened this issue Aug 7, 2019 · 0 comments

Comments

@amatkovsky
Copy link
Contributor

amatkovsky commented Aug 7, 2019

Consider the following code:

class ThingImpl extends Thing<String, Integer> {}

abstract class Thing<V, T> {
    @Inject Provider<V> vProvider;

    @Inject Provider<T> tProvider;

    @Inject V value;

    @Inject T t;
  }

...
component.inject(thingImpl);
...

When ReflectiveMembersInjector goes through the @Inject-annotated fields it tries to look
V and T bindings. Obviously, there are no such bindings since the actual bindings provide a String and an Integer. This leads to an error: IllegalArgumentException: No provider available for V.

See related pr with a test case: #167

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant