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

Migrate to ksp 2 #28

Merged
merged 4 commits into from
Aug 21, 2024
Merged

Migrate to ksp 2 #28

merged 4 commits into from
Aug 21, 2024

Conversation

ZemtsovVU
Copy link
Contributor

Dependency versions were updated and migration to KSP2 was performed.

kotlinpoet now includes code like this

// FunSpec.kt

if (returnType != UNIT || emitUnitReturnType()) {
  codeWriter.emitCode(": %T", returnType)
}

/**
 * Returns whether [Unit] should be emitted as the return type.
 *
 * [Unit] is emitted as return type on a function only if it is an expression body.
 */
private fun emitUnitReturnType(): Boolean {
  if (isConstructor) {
    return false
  }
  if (name == GETTER || name == SETTER) {
    // Getter/setters don't emit return types
    return false
  }

  return body.asExpressionBody() != null
}

accordingly, I had to remove the explicit Unit type as function return type.

@ZemtsovVU ZemtsovVU marked this pull request as ready for review July 24, 2024 11:34
build.gradle.kts Outdated Show resolved Hide resolved
@outadoc
Copy link
Collaborator

outadoc commented Aug 21, 2024

Looks good, thank you for your contribution @ZemtsovVU! 🎉

@outadoc outadoc merged commit b733aea into BedrockStreaming:main Aug 21, 2024
1 check passed
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