https://kotlinlang.org logo
#arrow
Title
s

sindrenm

09/12/2023, 10:28 AM
With the Arrow 1.2.1 (and possibly 1.2.0) Optics KSP plugin, one of the files seem to get an import with a broken alias. I don't quite know why it's even importing the type, as the type it imports is in the same package as the generated code. And the import alias is broken because the package it's in includes the segment ``data`` : Here's the top of the generated WorkoutHistoryPage__Optics.kt:
Copy code
package com.sats.core.`data`.workouts.models

import arrow.core.left
import arrow.core.right
import arrow.core.toOption
import com.sats.core.`data`.workouts.models.WorkoutHistoryPage as comsatscore`data`workoutsmodelsWorkoutHistoryPage
This results in a compilation error because of the import alias:
WorkoutHistoryPage__Optics.kt678 Expecting a top level declaration
This does work in 1.1.5, where the import is not generated.
a

Alejandro Serrano Mena

09/12/2023, 12:05 PM
it seems like a bug, I’ll have a look at this during this week
🙌 1
s

sindrenm

09/12/2023, 12:07 PM
Thanks! simple smile
Did you have some time to look at this? And should I file an issue on GitHub? I didn't do it because the issue templates seem to suggest that it's used primarily for feature requests and adding the company logo to the list of users, but I could file an issue without using a template, of course.
I made https://github.com/arrow-kt/arrow/issues/3134, as I saw there were other issues there already that didn't follow any of the templates.
2 Views