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

GeneratedFiles#addSourceFile should not allow to add a source in the default package #31629

Closed
github-actions bot opened this issue Nov 20, 2023 · 1 comment
Assignees
Labels
theme: aot An issue related to Ahead-of-time processing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Milestone

Comments

@github-actions
Copy link
Contributor

Backport of gh-31628

@github-actions github-actions bot added theme: aot An issue related to Ahead-of-time processing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug labels Nov 20, 2023
@github-actions github-actions bot added this to the 6.0.15 milestone Nov 20, 2023
@snicoll snicoll changed the title GeneratedFiles#addSourceFile does not take default package into account GeneratedFiles#addSourceFile should not allow to add a source in the default package Nov 20, 2023
@snicoll snicoll self-assigned this Nov 20, 2023
snicoll added a commit that referenced this issue Nov 20, 2023
Adding generated code in the default package is not supported as we
intend to import it, most probably from another package, and that is
not supported. While this situation is hard to replicate with Java,
Kotlin is unfortunately more lenient and users can end up in that
situation if they forget to add a package statement.

This commit checks for the presence of a valid package, and throws
a dedicated exception if necessary.

Closes gh-31629
Copy link
Contributor Author

Fixed via 0fc3811

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: aot An issue related to Ahead-of-time processing type: backport An issue that is a backport of another issue to a maintenance branch type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant