We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following fails to build:
@Component interface FooComp { Foo<Integer> foo(); } @Reusable class Foo<T> { @Inject Foo() {} } Error:(26, 44) error: incompatible types: Provider<Foo<Object>> cannot be converted to Provider<Foo<Integer>>
However, when adding another @Inject element or removing scoping it succeeds:
@Inject
@Reusable class Foo<T> { @Inject Foo() {} @Inject void postConstruct() {} }
The problem in the first case is that Dagger is overeager to use a single static factory instance for generating instances of scoped generic classes.
The text was updated successfully, but these errors were encountered:
I guess all that's really missing in the generated code is a typecast to Provider to achieve erasure bliss. Didn't spot it right away.
Provider
Sorry, something went wrong.
The issue does not occur with -source 1.8. It does with -source 1.7.
-source 1.8
-source 1.7
Use a raw framework class to avoid Java 7's poor type inference when …
0bf2f9d
…scoping generic @Inject classes. Fixes #671 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=154187714
df43ccb
netdpb
No branches or pull requests
The following fails to build:
However, when adding another
@Inject
element or removing scoping it succeeds:The problem in the first case is that Dagger is overeager to use a single static factory instance for generating instances of scoped generic classes.
The text was updated successfully, but these errors were encountered: