Skip to content

Commit a15e1f0

Browse files
committed
fixing same issue for extension generation by ksp with test
1 parent 0093659 commit a15e1f0

File tree

2 files changed

+34
-5
lines changed

2 files changed

+34
-5
lines changed

plugins/symbol-processor/src/main/kotlin/org/jetbrains/dataframe/ksp/ExtensionsGenerator.kt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import com.google.devtools.ksp.symbol.KSClassifierReference
1212
import com.google.devtools.ksp.symbol.KSDeclaration
1313
import com.google.devtools.ksp.symbol.KSFile
1414
import com.google.devtools.ksp.symbol.KSName
15-
import com.google.devtools.ksp.symbol.KSPropertyDeclaration
1615
import com.google.devtools.ksp.symbol.KSTypeReference
1716
import com.google.devtools.ksp.symbol.KSValueArgument
1817
import com.google.devtools.ksp.symbol.Modifier
@@ -61,11 +60,10 @@ class ExtensionsGenerator(
6160
return when {
6261
isClassOrInterface() && effectivelyPublicOrInternal() -> {
6362
DataSchemaDeclaration(
64-
this,
65-
declarations
66-
.filterIsInstance<KSPropertyDeclaration>()
63+
origin = this,
64+
properties = getAllProperties()
6765
.map { KSAnnotatedWithType(it, it.simpleName, it.type) }
68-
.toList()
66+
.toList(),
6967
)
7068
}
7169
else -> null

plugins/symbol-processor/src/test/kotlin/org/jetbrains/dataframe/ksp/DataFrameSymbolProcessorTest.kt

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -748,6 +748,37 @@ class DataFrameSymbolProcessorTest {
748748
result.successfulCompilation shouldBe true
749749
}
750750

751+
@Test
752+
fun `generic interface as supertype`() {
753+
val result = KspCompilationTestRunner.compile(
754+
TestCompilationParameters(
755+
sources = listOf(
756+
SourceFile.kotlin(
757+
"MySources.kt",
758+
"""
759+
package org.example
760+
761+
$imports
762+
763+
interface KeyValue<T> {
764+
val key: String
765+
val value: T
766+
}
767+
768+
@DataSchema
769+
interface MySchema : KeyValue<Int>
770+
771+
772+
val ColumnsContainer<MySchema>.test1: DataColumn<String> get() = key
773+
val DataRow<MySchema>.test2: Int get() = value
774+
""".trimIndent()
775+
)
776+
)
777+
)
778+
)
779+
result.successfulCompilation shouldBe true
780+
}
781+
751782
@Test
752783
fun `nested interface`() {
753784
val result = KspCompilationTestRunner.compile(

0 commit comments

Comments
 (0)