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

Arrow Core 2 causes undeclared type variable: A when using NonEmptyList #3557

Open
dcampogiani opened this issue Dec 24, 2024 · 2 comments
Open

Comments

@dcampogiani
Copy link
Contributor

Hi,

when I try to inject with Hilt a component returning NonEmptyList, such as:

internal fun interface StateBuilder {
    fun build(): NonEmptyList<String>
}

I'm getting

bad class file: /Users/danielecampogiani/Developing/android/arrow-2-empty-list-issue/app/build/tmp/kotlin-classes/debug/com/danielecampogiani/StateBuilder.class
undeclared type variable: A
Please remove or make sure it appears in the correct subdirectory of the classpath.

I've created a reproducible issue in this repo: https://github.com/dcampogiani/Arrow-Core-2-NonEmptyList-Issue

Dependencies:

  • arrowCore = "2.0.0"
  • hilt = "2.54"
  • kotlin = "2.1.0"

Everything works fine if I use arrowCore=1.2.4, or replace NonEmptyList with List

@hoc081098
Copy link
Contributor

hoc081098 commented Dec 24, 2024

NonEmptyList v1.2.4 is a normal class.
Since 2.0.0, it is a @JvmInline value class.
Does Hilt/Dagger support @JvmInline value class?

@kyay10
Copy link
Collaborator

kyay10 commented Dec 24, 2024

I believe a similar issue has been reported, and a hot fix either has been released or will be released soon. The issue is that the type parameter of Nel needs to have the same name as the type parameter of List, so the fix does precisely that. I'll try to find the related issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants