in Anvil's sample. I wonder will dagger differentiate
@SingleIn(Scope1::class)
and
@SingleIn(Scope2::class)
during code generation (and after) as different scopes? JSR docs seem to mention that
@Scope
-ed annotations shouldn't have attributes, so I thought does this mean dagger will look only at annotation name?
z
Zac Sweers
02/24/2022, 2:36 PM
it does differentiate
👍 1
t
trevjones
02/25/2022, 3:41 AM
I have never seen this, is it isolated to D1 or something present in D2 as well? Looks an awful lot like something near the shape of scope private bindings
z
Zac Sweers
02/25/2022, 4:41 AM
it's a custom construct, nothing fancy
Zac Sweers
02/25/2022, 4:41 AM
we do it too
Zac Sweers
02/25/2022, 4:41 AM
Copy code
/**
* Indicates that this provided type (via [Provides], [Binds], [Inject], etc) will only have a single instance within
* the target [value] scope.
*
* Note that the [value] does not actually need to be a [Scope]-annotated annotation class. It is _solely_ a key.
*/
@Scope
@MustBeDocumented
@Retention(RUNTIME)
annotation class SingleIn(val value: KClass<*>)