You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use multi-injection to provide 2 different maps of ComplexKey -> Provider<Type>. This works great as long as the ComplexKey does not have a parameter that is also a Complex Key. This error ONLY occurs when the nested value is requested as an array, not if requested as a single value.
Snippet
// This works perfectly
@MapKey(unwrapValues = false)
annotation class TopKey(val value: String, val otherValue: Boolean)
// This fails
@MapKey(unwrapValues = false)
annotation class TopKey(val value: String, val otherValues: Array<NestedKey> = [])
@MapKey(unwrapValues = false)
annotation class NestedKey(val value: String, val otherValue: Boolean)
// This also works
@MapKey(unwrapValues = false)
annotation class TopKey(val value: String, val otherValues: NestedKey = NestedKey("", false))
@MapKey(unwrapValues = false)
annotation class NestedKey(val value: String, val otherValue: Boolean)
TopKeyCreator.createTopKey("example3", new NestedKey[] {TopKeyCreator.createNestedKey(Zoo.class, Example3.class)})
This seems to be a bug from Dagger, as the createNestedKey is generated for NestedKeyCreator, I think here, we should get the creator name with the annotation passed in.
I will send out a fix shortly, thanks for reporting it!
When generating creator for annotation, the case when the return type is an array was ignored previously.
fixes#4262
RELNOTES=n/a
PiperOrigin-RevId: 616200494
Problem
I'm trying to use multi-injection to provide 2 different maps of
ComplexKey -> Provider<Type>
. This works great as long as theComplexKey
does not have a parameter that is also a Complex Key. This error ONLY occurs when the nested value is requested as an array, not if requested as a single value.Snippet
Repo
I've created this small repo to repro https://github.com/martofeld/dagger-multibinding-issu
The text was updated successfully, but these errors were encountered: