Hi, is compiling with Kotlin 1.4 supported atm? A...
# arrow
m
Hi, is compiling with Kotlin 1.4 supported atm? Anyway, @optics annotated classes don't seem to be able to be processed by kapt due to an exception in kotlin-metadata. I'm getting the following error with 0.10.5 and with 0.11.0-SNAPSHOT:
Copy code
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':common:kaptKotlin'.
<...>
Caused by: kotlin.KotlinNullPointerException
	at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata$data$2.invoke(KotlinMetadata.kt:55)
	at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata$data$2.invoke(KotlinMetadata.kt:53)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at me.eugeniomarletti.kotlin.metadata.KotlinClassMetadata.getData(KotlinMetadata.kt)
	at arrow.optics.OpticsProcessor.getClassType(OpticsProcessor.kt:130)
	at arrow.optics.OpticsProcessor.onProcess(OpticsProcessor.kt:39)
	at arrow.common.utils.AbstractProcessor.process(AbstractProcessor.kt:108)
	at org.jetbrains.kotlin.kapt3.base.incremental.IncrementalProcessor.process(incrementalProcessors.kt)
	at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:161)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
	at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
	at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
	at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
	at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:78)
	... 27 more
👀 1
s
Hey @Manuel Roblek, We saw this happening on our side as well. We're currently investigating how we can fix this. This is a problem caused in a library we depend on. We're not sure what the most straight forward way to fix this is yet.
👀 1
m
Im interested in updating to Kotlin 1.4.0 as well in a project where I am using arrow including optics. Is there any update on this topic so far? 🙂
s
Hey @Mervyn McCreight, Sadly it seems there is too much broken in the compiler generated code, and the maintainer of the library that broke told us he isn't going to update. So we're facing a hard decision where we'd need to either rewrite all the kapt generators, or move to Arrow Meta asap 😕
m
Hi @simon.vergauwen Thanks for your fast answer 👍 Oh okay 😢 My option for now to be able to update kotlin and still use arrow would be to not use the
@optics
annotation for now, or am I missing some other options I have? : )
s
The only other temporary solution I can think of is put your domain definitions in a module with the Kotlin version that still works. However given there is so much changes in 1.4, I'm not sure you'll not encounter any other issues there between mixing 1.3.x and 1.4.x.
I haven't attempted this yet
m
I can confirm that @simon.vergauwen's suggestion works fine with 1.4