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

Add support for KSAnnotation.toAnnotationSpec() #1196

Merged
merged 5 commits into from Dec 9, 2021
Merged

Conversation

ZacSweers
Copy link
Collaborator

Ported from Moshi at @swankjesse's suggestion - square/moshi#1393 (comment)

Copy link
Collaborator

@Egorand Egorand left a comment

Choose a reason for hiding this comment

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

Great tests!

Comment on lines +35 to +36
is ClassName -> AnnotationSpec.builder(type)
is ParameterizedTypeName -> AnnotationSpec.builder(type)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would Kotlin allow merging these two branches and still get correct typecasts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unfortunately not, we provide two overloads for each of those but no option for just the typename

@ZacSweers ZacSweers merged commit 5d9a3e2 into master Dec 9, 2021
@ZacSweers ZacSweers deleted the z/kspAnnotations branch December 9, 2021 06:21
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 this pull request may close these issues.

None yet

2 participants