Dyescape / kotlin-maven-symbol-processing

KSP extension for the kotlin-maven-plugin
MIT License
39 stars 6 forks source link

Version 1.3 doesn't seem to work well with Arrow Optics. #73

Closed jesperancinha closed 1 year ago

jesperancinha commented 1 year ago

Hi there,

I have a project where I do all sorts of Kotlin studies and it compiles great with version 1.2 of this plugin. It works very very well with all things Project Arrow related. It generates @optics source code perfectly and I have no issues with it. Version 1.3 though, doesn't seem to work with Arrow and I get this exception constantly:

Error:  Failed to execute goal org.jetbrains.kotlin:kotlin-maven-plugin:1.7.22:compile (compile) on
 project jeorg-kotlin-optics-crums-1: Compilation failure
Error:  java.lang.NoSuchMethodError:
 'void org.jetbrains.kotlin.codegen.state.KotlinTypeMapper.<init>(org.jetbrains.kotlin.resolve.BindingContext, 
org.jetbrains.kotlin.codegen.ClassBuilderMode, java.lang.String, 
org.jetbrains.kotlin.config.LanguageVersionSettings, boolean,
 org.jetbrains.kotlin.codegen.state.IncompatibleClassTracker, org.jetbrains.kotlin.config.JvmTarget, boolean,
 kotlin.jvm.functions.Function1, 
kotlin.jvm.functions.Function1, int, kotlin.jvm.internal.DefaultConstructorMarker)'

Here is a build example: https://github.com/jesperancinha/jeorg-kotlin-test-drives/actions/runs/3725908532/jobs/6319000885

Maybe I'm missing something or perhaps there is just something not working very well with Arrow?

fxshlein commented 1 year ago

Hi! Thank you for the report.

The Issue is probably that the old 1.3 version was for kotlin 1.6.21, and KSP itself uses some kotlin internals, so it breaks fairly easily across versions.

We just released version 1.4 for kotlin 1.7.22. Does using that new version fix the issue?

jesperancinha commented 1 year ago

Hi @fxshlein, yes, this new version fixes the issue! thank you!