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

Dokka migration to KGP 2.1 leads to Non-public primary constructor is exposed via the generated 'copy()' method of the 'data' class. #3691

Open
atyrin opened this issue Jul 11, 2024 · 0 comments
Labels

Comments

@atyrin
Copy link
Contributor

atyrin commented Jul 11, 2024

After switching KGP version to 2.1, Dokka project compilations starts failing with:

:dokka-subprojects:dokka-core:compileKotlin
  e: file:///mnt/agent/work/d31362561ee267fb/user-project/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/model/properties/PropertyContainer.kt:7:46 Non-public primary constructor is exposed via the generated 'copy()' method of the 'data' class.
  
  The generated 'copy()' will change its visibility in future releases.
  
  To suppress the warning do one of the following:
  - Annotate the data class with the '@ConsistentCopyVisibility' annotation.
  - Use the '-Xconsistent-data-class-copy-visibility' compiler flag.
  - Annotate the data class with the '@ExposedCopyVisibility' annotation
    (Discouraged, but can be used to keep binary compatibility).
  
  To learn more, see the documentation of the '@ConsistentCopyVisibility' and '@ExposedCopyVisibility' annotations.
  
  
  e: file:///mnt/agent/work/d31362561ee267fb/user-project/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/DokkaJavaPlugin.kt:33:44 Non-public primary constructor is exposed via the generated 'copy()' method of the 'data' class.
  
  The generated 'copy()' will change its visibility in future releases.
  
  To suppress the warning do one of the following:
  - Annotate the data class with the '@ConsistentCopyVisibility' annotation.
  - Use the '-Xconsistent-data-class-copy-visibility' compiler flag.
  - Annotate the data class with the '@ExposedCopyVisibility' annotation
    (Discouraged, but can be used to keep binary compatibility).
  
  To learn more, see the documentation of the '@ConsistentCopyVisibility' and '@ExposedCopyVisibility' annotations.
  
  
  e: file:///mnt/agent/work/d31362561ee267fb/user-project/dokka-subprojects/core/src/main/kotlin/org/jetbrains/dokka/plugability/extensions.kt:9:43 Non-public primary constructor is exposed via the generated 'copy()' method of the 'data' class.
  
  The generated 'copy()' will change its visibility in future releases.
  
  To suppress the warning do one of the following:
  - Annotate the data class with the '@ConsistentCopyVisibility' annotation.
  - Use the '-Xconsistent-data-class-copy-visibility' compiler flag.
  - Annotate the data class with the '@ExposedCopyVisibility' annotation
    (Discouraged, but can be used to keep binary compatibility).
  
  To learn more, see the documentation of the '@ConsistentCopyVisibility' and '@ExposedCopyVisibility' annotations.

https://kotlinlang.org/docs/whatsnew-eap.html#data-class-copy-function-to-have-the-same-visibility-as-constructor

@atyrin atyrin added the bug label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant