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

Convert RecordJsonAdapter to Kotlin #1493

Merged
merged 9 commits into from
Jan 11, 2022
Merged

Conversation

ZacSweers
Copy link
Collaborator

Requires a bit of extra tweaking for the kotlin compilation task

@@ -11,20 +12,27 @@ plugins {
}

val mainSourceSet by sourceSets.named("main")
val java16 by sourceSets.creating {
val java16: SourceSet by sourceSets.creating {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it was nagging me about a platform type so made it explicit

}

val constructor = try {
lookup.findConstructor(rawType, methodType(knownNotNull(Void::class.javaPrimitiveType), componentRawTypes))
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should we save off the knownNotNull(Void::class.javaPrimitiveType) as a top-level property?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it just a better-documented !!? If it's used extensively yeah can be a top-level property.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It skips the nullcheck

}

val constructor = try {
lookup.findConstructor(rawType, methodType(knownNotNull(Void::class.javaPrimitiveType), componentRawTypes))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it just a better-documented !!? If it's used extensively yeah can be a top-level property.

@ZacSweers ZacSweers merged commit 396342b into master Jan 11, 2022
@ZacSweers ZacSweers deleted the z/recordJsonAdaptersKotlin branch January 11, 2022 20:39
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.

2 participants