Skip to content
This repository has been archived by the owner on Aug 26, 2021. It is now read-only.

Don't explode on wildcard types #118

Open
swankjesse opened this issue Nov 25, 2012 · 2 comments
Open

Don't explode on wildcard types #118

swankjesse opened this issue Nov 25, 2012 · 2 comments
Milestone

Comments

@swankjesse
Copy link
Contributor

Given this input:

    @Provides Class<? extends MyInterface> provideClassImpl() {
        return InterfaceImpl.class;
    }

Dagger fails like this:

java.lang.UnsupportedOperationException: Uninjectable type ? extends com.sample.app.di.MyInterface
E/AndroidRuntime( 6701):        at dagger.internal.Keys.typeToString(Keys.java:169)
E/AndroidRuntime( 6701):        at dagger.internal.Keys.typeToString(Keys.java:161)
E/AndroidRuntime( 6701):        at dagger.internal.Keys.get(Keys.java:79)
E/AndroidRuntime( 6701):        at dagger.internal.Keys.get(Keys.java:111)

We should handle wildcard types!

@swankjesse
Copy link
Contributor Author

This error is good enough 'til we do two-phase code gen.

cgruber added a commit to cgruber/dagger that referenced this issue Aug 24, 2015
Shade the output jar, and relocate artifacts likely to cause collisions (notably auto-common)
@JakeWharton
Copy link
Collaborator

This is also annoying for set bindings where I want to collect a bunch of, say, Async<?> things and not really care what their generic param is.

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

No branches or pull requests

2 participants