Skip to content
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

["Request"] Specify visibility modifier explicitly in the generated code #2761

Closed
aangairbender opened this issue Jul 13, 2022 · 0 comments · Fixed by #2763
Closed

["Request"] Specify visibility modifier explicitly in the generated code #2761

aangairbender opened this issue Jul 13, 2022 · 0 comments · Fixed by #2763

Comments

@aangairbender
Copy link

aangairbender commented Jul 13, 2022

What version are you currently using?
1.1.2

What would you like to see?

In my kotlin project I am using Arrow Optics with @optics code generation.
I am trying to use explicitApi() to publish it as a library.
But build fails with Visibility must be specified in explicit API mode in the generated code (I am using ksp).
I would suggest adding explicit visibility modifier in the generated code, e.g.

// now
inline val ... = ...

// after fix
public inline val ... = ...
// or
internal inline val ... = ...

Visibility of generated extensions can be the same as companion object visibility.

Some thoughts

Because generated code has no documentation, it makes sense to make it internal and manually provide public wrappers for some of the generated optics. But in this case, we still need to have explicit internal visibility modifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant