8000 Multibinding with Nested Complex Keys uses the wrong AnnotationCreator · Issue #4262 · google/dagger · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Multibinding with Nested Complex Keys uses the wrong AnnotationCreator #4262
Closed
@martofeld

Description

@martofeld

Problem

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)

Repo

I've created this small repo to repro https://github.com/martofeld/dagger-multibinding-issu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0