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

Duplicate ContributesMultibinding check does not consider ignoreQualifier #986

Open
gabrielittner opened this issue Apr 26, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@gabrielittner
Copy link
Contributor

Having ContributesMultibinding once without ignoreQualifier and once with results in an error that the contributions need to be distinct.

@Named("test")
@ContributesMultibinding(AppScope::class, DeepLinkHandler::class)
@ContributesMultibinding(AppScope::class, DeepLinkHandler::class, ignoreQualifier = true)
class FooDeepLink @Inject constructor() : DeepLinkHandler {}
e: com.squareup.anvil.compiler.api.AnvilCompilationException: Back-end (JVM) Internal error: com.freeletics.feature.foo.FooDeepLinkHandler contributes multiple times to the same scope using the same bound type: [DeepLinkHandler]. Contributing multiple times to the same scope with the same bound type is forbidden and all scope - bound type combinations must be distinct.

The distinct check should consider ignoreQualifier as well since it results in 2 distinct contributions.

@RBusarow RBusarow self-assigned this Apr 29, 2024
@RBusarow RBusarow added the bug Something isn't working label Apr 29, 2024
@RBusarow
Copy link
Member

RBusarow commented May 1, 2024

In this case, there's no need for the qualifier. The unqualified version is contributed to the qualified set as well, so it is in fact a duplicate binding. Am I missing something?

Nevermind, that's not true. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants