diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSClassDeclarationEnumEntryImpl.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSClassDeclarationEnumEntryImpl.kt index cad62ca2f2..ea3e54e6ab 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSClassDeclarationEnumEntryImpl.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSClassDeclarationEnumEntryImpl.kt @@ -109,20 +109,6 @@ class KSClassDeclarationEnumEntryImpl private constructor(private val ktEnumEntr override val annotations: Sequence = emptySequence() - override val isActual: Boolean - get() = TODO("Not yet implemented") - - override val isExpect: Boolean - get() = TODO("Not yet implemented") - - override fun findActuals(): Sequence { - TODO("Not yet implemented") - } - - override fun findExpects(): Sequence { - TODO("Not yet implemented") - } - override val declarations: Sequence by lazy { // TODO: fix after .getDeclaredMemberScope() works for enum entry with no initializer. emptySequence() diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSExpectActualImpl.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSExpectActualImpl.kt index d53a447272..1eef00aa43 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSExpectActualImpl.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/symbol/kotlin/KSExpectActualImpl.kt @@ -19,19 +19,27 @@ package com.google.devtools.ksp.impl.symbol.kotlin import com.google.devtools.ksp.symbol.KSDeclaration import com.google.devtools.ksp.symbol.KSExpectActual import org.jetbrains.kotlin.analysis.api.symbols.KtDeclarationSymbol +import org.jetbrains.kotlin.analysis.api.symbols.markers.KtPossibleMultiplatformSymbol class KSExpectActualImpl(private val declarationSymbol: KtDeclarationSymbol) : KSExpectActual { override val isActual: Boolean - get() = TODO("Not yet implemented") + get() = (declarationSymbol as? KtPossibleMultiplatformSymbol)?.isActual == true override val isExpect: Boolean - get() = TODO("Not yet implemented") + get() = (declarationSymbol as? KtPossibleMultiplatformSymbol)?.isExpect == true + // TODO: not possible in new KMP model, returning empty sequence for now. override fun findActuals(): Sequence { - TODO("Not yet implemented") + return emptySequence() } override fun findExpects(): Sequence { - TODO("Not yet implemented") + return if (!isActual) { + emptySequence() + } else { + analyze { + declarationSymbol.getExpectForActual()?.toKSDeclaration() + }?.let { sequenceOf(it) } ?: emptySequence() + } } }