I’m having issues using optics’ ksp plugin within a multiplatform project with iOS targets. I get conflicting declarations from the generated code. (error in thread). I noticed that the same code is generated and put in all
build/generated/ksp/metadata/commonMain/kotlin
and
build/generated/ksp/ios*/ios*Main/kotlin
. Hence I get errors for each generated declaration for each ios target. Is it expected to have generated code for each target and not just in the common directory? The code I have annotated with
@optics
resides within the
shared
folder.
I’ve also created a minimum reproduce project (link in thread).
dephinera
02/06/2024, 7:11 PM
Error:
Copy code
e: file:.../TestKSP/shared/build/generated/ksp/metadata/commonMain/kotlin/com/exampleapp/testksp/CommonSealed.A__Optics.kt:25:85 Conflicting declarations: public val CommonSealed.A.Companion.value
e: file:.../TestKSP/shared/build/generated/ksp/iosArm64/iosArm64Main/kotlin/com/exampleapp/testksp/CommonSealed.A__Optics.kt:25:85 Conflicting declarations: public val CommonSealed.A.Companion.value
...