Iliyan Germanov
04/27/2023, 7:58 PMkapt
in this file.
> Task :core:kaptDebugKotlinAndroid
Values of variant API AnnotationProcessorOptions.arguments are queried and may return non final values, this is unsupported
/home/iliyan/work/repo/ivy-wallet/core/build/tmp/kapt3/stubs/debug/ivy/core/domain/AccountCacheKt.java:6: error: cannot access Raise
private static final java.lang.Object invalidateAffectedCaches(ivy.core.persistence.AccountCachePersistence _context_receiver_0, arrow.core.raise.Raise<? super ivy.core.persistence.data.PersistenceError> _context_receiver_1, java.util.List<? extends ivy.core.persistence.data.ItemChange<? super ivy.core.data.Transaction>> changes, kotlin.coroutines.Continuation<? super kotlin.Unit> $completion) {
^
bad class file: /home/iliyan/.gradle/caches/modules-2/files-2.1/io.arrow-kt/arrow-core-jvm/1.2.0-RC/815591a96f11786ae0ff746a4931fee9c0e46ac4/arrow-core-jvm-1.2.0-RC.jar(/arrow/core/raise/Raise.class)
undeclared type variable: T
Please remove or make sure it appears in the correct subdirectory of the classpath.
> Task :core:kaptDebugKotlinAndroid FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':core:kaptKotlinJvm'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
> java.lang.reflect.InvocationTargetException (no error message)
Iliyan Germanov
04/27/2023, 8:29 PMbad class file: /home/iliyan/.gradle/caches/modules-2/files-2.1/io.arrow-kt/arrow-core-jvm/1.2.0-RC/815591a96f11786ae0ff746a4931fee9c0e46ac4/arrow-core-jvm-1.2.0-RC.jar(/arrow/core/raise/Raise.class)
undeclared type variable: T
Please remove or make sure it appears in the correct subdirectory of the classpath.
simon.vergauwen
04/27/2023, 10:07 PMRaise
related extension or context receiver function out of the file using kapt fixed the issue. So it seems like some strange but related to kapt but I have no idea how we can be causing it since Raise
is just an interface.Iliyan Germanov
04/27/2023, 10:19 PMkapt
in the AccountCache.kt
file. I need kapt because of Dagger + Anvil for Slack's Circuit. If there isn't such, I'll have to drop the Dagger + Anvil DI.
Tried:
• downgrading kapt
• upgraded Kotlin
Any ideas for things to try?simon.vergauwen
04/27/2023, 10:28 PMsimon.vergauwen
04/27/2023, 10:31 PMpublishMaven
on your local machine.
To do that you need to define an arbitrary projects.version
in gradle.properties
. https://github.com/arrow-kt/arrow/blob/c7f3af57106651b0810918e773ed5e546c980943/gradle.properties#L2
Or it will appear as arrow-core:unspecified
in your mavenLocal()
repositoryIliyan Germanov
04/27/2023, 10:37 PMMarcus Ilgner
03/04/2024, 3:22 PMsuspend fun manyById(ids: NonEmptySet<I>): Either<DataRetrievalError, NonEmptySet<T>>
I have tried fiddling around with the signature (including getting rid of the suspend
modifier) but nothing seems to work. After removing the function, it compiles again.
The error:
bad class file: [...]/api/build/libs/api-0.3.14.jar(/io/redigital/rebased/api/AbstractRepository.class)
undeclared type variable: A
Please remove or make sure it appears in the correct subdirectory of the classpath.
I understand that this is probably not really related to Arrow but an issue with kapt. Any tips on what I could do?Marcus Ilgner
07/01/2024, 11:51 AMundeclared type variable
in various scenarios, my colleagues and I found that when passing the type parameter of NonEmptySet
on to our clients, it would only work when naming it A
.
For example, the following method in one of our interfaces would complain `undeclared type variable: A`:
operator fun <AT, AF : AggregateFunction<AT>> invoke(
dataResource: DataResource,
queryOptions: DataPointQueryOptions,
aggregateFunctions: NonEmptySet<AF>,
): AggregatedValues<AF, AT>
because the type parameter was named AF
and it was exposed to the interface. After renaming it from AF
to A
, everything worked again.
I think it might be a good idea to add this to the documentation? Furthermore, it would be interesting to know what makes NonEmptySet
so special that it causes this behaviour when we never had issues with other interfaces like Option
that we expose as part of our interfaces, too. Although that could be because usually there's only one type parameter involved and it's named T
... 🤔Youssef Shoaib [MOD]
07/01/2024, 3:22 PMMarcus Ilgner
07/02/2024, 8:17 AM