-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Arrow Optics] Generated optics code does not escape Kotlin keywords in package names #2924
Comments
Searching through the issues I found this one where a similar problem is mentioned. It however was closed with the message that "[arrow] are no longer supporting this type of type class in Arrow in the latest versions". Probably this is referring to the If my understanding is correct, would a pull request looking at solving this issue be appreciated? |
Hey @hrafnthor, |
I have staged a PR #2925 for consideration. As this is my first contribution to the arrow project, all constructive feedback is appreciated as any norms and coding styles within it are currenlty unknown to me. After going over the contribution document, I noticed that use of I did notice that all the unit tests contained in Please let me know if you would want me to add those changes as well to the PR. They use the same functionality that the PR already adds, but in other locations. |
Thank you so much for creating a PR fixing the issues you reported so fast 😍
No, you're correct. We had some conflict between KotlinX Knit and Spotless and had to temporarily disable it. We're in the process of re-adding it to the project.
I am not sure why those tests would break 🤔 Feel free to add the fix to the PR, it sounds like the changes are related. Need to make some time to review your changes in Optics, it's been some time since I worked on it so need to take a closer look 😅 |
Sorry, I was probably not too clear on what I meant 🙂 As can be seen in the changes made in the PR here there were mock If the same dummy package field is added to any of the other test cases in
I've added those other changes to the PR now 👍 |
Closed by #2925 |
Description:
Testing out using 'arrow-optics' in a project of mine, it immediatly caused compilation errors due to package names in the generated code containing unescaped Kotlin keywords from the originator package.
For instance the following code is from my project
And it generates the following:
In this case the keyword is being used in the package name to reference a reverse TLD.
A list of TLD's that match Kotlin's reserved keywords:
Versions
arrow: 1.1.5
kotlin: 1.8.0
ksp: 1.8.0-1.0.8
The text was updated successfully, but these errors were encountered: