diff --git a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt index 9587731be2..bdbd793494 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/utils.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/utils.kt @@ -234,10 +234,10 @@ fun KSDeclaration.isPrivate() = this.modifiers.contains(Modifier.PRIVATE) fun KSDeclaration.isJavaPackagePrivate() = this.getVisibility() == Visibility.JAVA_PACKAGE fun KSDeclaration.closestClassDeclaration(): KSClassDeclaration? { - if (this is KSClassDeclaration) { - return this + return if (this is KSClassDeclaration) { + this } else { - return this.parentDeclaration?.closestClassDeclaration() + this.parentDeclaration?.closestClassDeclaration() } } diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/CommandLineKSPLogger.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/CommandLineKSPLogger.kt index 223e2db242..dc046cebe4 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/CommandLineKSPLogger.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/CommandLineKSPLogger.kt @@ -22,7 +22,7 @@ import com.google.devtools.ksp.symbol.KSNode class CommandLineKSPLogger : KSPLogger { // TODO: support logging level. - val messager = System.err + private val messager = System.err override fun logging(message: String, symbol: KSNode?) { messager.println(message) }