amzn / kotlin-inject-anvil

Extensions for the kotlin-inject dependency injection framework
Apache License 2.0
274 stars 8 forks source link

Unclear error message when scope type for `@ContributesBinding` is not imported #65

Open kirillzh opened 1 month ago

kirillzh commented 1 month ago

Code


// note AppScope import is missing
import me.tatarka.inject.annotations.Inject
// import software.amazon.lastmile.kotlin.inject.anvil.AppScope
import software.amazon.lastmile.kotlin.inject.anvil.ContributesBinding

@Inject
@ContributesBinding(AppScope::class)
class NfcSessionImpl(
  ...
)

Error:

e: [ksp] Qualified name was null for <ERROR TYPE: AppScope>
e: [ksp] java.lang.IllegalArgumentException: Qualified name was null for <ERROR TYPE: AppScope>
        at software.amazon.lastmile.kotlin.inject.anvil.ContextAware$DefaultImpls.requireNotNull(ContextAware.kt:38)