-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Support arguments for scope annotations #377
Labels
enhancement
New feature or request
Comments
evant
added a commit
that referenced
this issue
Apr 23, 2024
ex: @NamedScope("one") and @NamedScope("two") are now treated as distinct scopes. Fixes #377
Interestingly enough the javadoc for Scope says they should not have attributes, but I verified that dagger does support this. |
evant
added a commit
that referenced
this issue
Apr 23, 2024
ex: @NamedScope("one") and @NamedScope("two") are now treated as distinct scopes. Fixes #377
Many many years ago (around 2017/18) in a conversation with a Dagger 2 maintainer he mentioned that they have to support it now, because many folks rely on it, but it's not part of the standard. They "accidentally" supported it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For each scope we need to define a new scope annotation, e.g.
Rather, I'd like to define a single annotation and use different arguments:
Then I only need to define new class references and can reuse the same scope:
The challenge is that more argument types such as ints, strings and enums must be supported for this.
Note that scope annotations using this mechanism today compile fine, but
@SingleIn(AppScope::class)
would be treated the same as@SingleIn(LoggedInScope::class)
. The argument is ignored for comparisons.The same should be supported for qualifiers #253.
The text was updated successfully, but these errors were encountered: