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

[Kotlin] Use of ExperimentalUnsignedTypes annotation in generated kotlin code #7862

Closed
aaronriekenberg opened this issue Mar 8, 2023 · 3 comments · Fixed by #7881
Closed

Comments

@aaronriekenberg
Copy link
Contributor

aaronriekenberg commented Mar 8, 2023

In Feb 2022 I made a PR to remove ExperimentalUnsignedTypes annotations on generated kotlin code, which was merged: #7092

I notice recently the generation of ExperimentalUnsignedTypes was added back to kotlin code generator: #7775

I am seeing with flatc version 23.3.3 this annotation is getting generated.

May I ask why this change was made in PR 7775 above?

In Kotlin >= 1.5 unsigned types are not experimental https://kotlinlang.org/docs/whatsnew15.html#stable-unsigned-integer-types

Putting this annotation into generated files generates a large number of compiler warnings for users of the code, unless the users code also contains @ExperimentalUnsignedTypes annotations.

Thanks!

@dbaileychess
Copy link
Collaborator

@anton-bobukh Could you comment if possible?

@paulovap
Copy link
Collaborator

Unsigned arrays are still experimental. So maybe the code generator could be improve to only generate the annotation with the usage of that.

@aaronriekenberg
Copy link
Contributor Author

aaronriekenberg commented Mar 24, 2023

Attempted a PR that I think might work to make the ExperimentalUnsignedTypes annotation opt-in only if unsigned array types are actually used. #7881

Please take a look - thank you!

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