Skip to content
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

Unclear error message when component argument's type is not imported #66

Open
kirillzh opened this issue Oct 29, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@kirillzh
Copy link

Code:

// import androidx.fragment.app.FragmentActivity // note this type import is missing
import me.tatarka.inject.annotations.Provides
import software.amazon.lastmile.kotlin.inject.anvil.ActivityScope
import software.amazon.lastmile.kotlin.inject.anvil.AppScope
import software.amazon.lastmile.kotlin.inject.anvil.ContributesSubcomponent
import software.amazon.lastmile.kotlin.inject.anvil.SingleIn

@ContributesSubcomponent(ActivityScope::class)
@SingleIn(ActivityScope::class)
interface ActivityComponent {
  @ContributesSubcomponent.Factory(AppScope::class)
  interface Factory {
    fun create(fragmentActivity: FragmentActivity): ActivityComponent
  }
}

Compilation error:

e: [ksp] java.lang.IllegalArgumentException: Error type '<ERROR TYPE: FragmentActivity>' is not resolvable in the current round of processing.
        at com.squareup.kotlinpoet.ksp.KsTypesKt.requireNotErrorType(KsTypes.kt:40)
        at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName(KsTypes.kt:71)
        at com.squareup.kotlinpoet.ksp.KsTypesKt.toTypeName(KsTypes.kt:202)
@vRallev vRallev added the enhancement New feature or request label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants