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

Hack kotlin compiler to not fail when annotation changes it's type from array to non-array #3859

Merged
merged 4 commits into from
Oct 21, 2024

Conversation

whyoleg
Copy link
Collaborator

@whyoleg whyoleg commented Oct 15, 2024

Fixes #3851 until update to Kotlin Compiler 2.1

@whyoleg whyoleg added the bug label Oct 15, 2024
@whyoleg whyoleg requested a review from vmishenev October 15, 2024 15:53
@whyoleg whyoleg self-assigned this Oct 15, 2024
"Deserialized ArrayValue should have the same number of elements as the original array value: $result"
}

// TODO: PATCH START
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only change to original file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on what the patch is in KDoc? Where was it copied from?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the link to the changes landed into kotlin.git and rephrased KDoc a bit

/**
* exposes [Subclass] from another module which has [SubclassOptInRequired] annotation present
*/
class Usage(
Copy link
Collaborator Author

@whyoleg whyoleg Oct 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test failes when generating documentation for this module second which depends on first.

It's not possible to write just a unit test for this, as we need to first compile first and then generate documentation for second with binary dependency on first to reproduce the issue.

Note: to test this, I was manually set version in TestedVersions to 2.1.0-Beta2.
I will prepare separate PR to run integration tests with 2.1.0-Beta2

@whyoleg whyoleg marked this pull request as ready for review October 16, 2024 11:00
@whyoleg whyoleg added this to the Dokka 2.0.0 milestone Oct 16, 2024
"Deserialized ArrayValue should have the same number of elements as the original array value: $result"
}

// TODO: PATCH START
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate on what the patch is in KDoc? Where was it copied from?

@whyoleg whyoleg merged commit 83dd1ec into master Oct 21, 2024
14 checks passed
@whyoleg whyoleg deleted the fix-annotation-deserialization branch October 21, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dokka fails with not array: KClass<out Annotation> on Kotlin 2.1.20-dev with @SubclassOptInRequired
2 participants