Skip to content

Commit 4855060

Browse files
committed
fixing same issue for extension generation by ksp with test
1 parent 853fb97 commit 4855060

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
@@ -706,6 +706,37 @@ class DataFrameSymbolProcessorTest {
706706
result.successfulCompilation shouldBe true
707707
}
708708

709+
@Test
710+
fun `generic interface as supertype`() {
711+
val result = KspCompilationTestRunner.compile(
712+
TestCompilationParameters(
713+
sources = listOf(
714+
SourceFile.kotlin(
715+
"MySources.kt",
716+
"""
717+
package org.example
718+
719+
$imports
720+
721+
interface KeyValue<T> {
722+
val key: String
723+
val value: T
724+
}
725+
726+
@DataSchema
727+
interface MySchema : KeyValue<Int>
728+
729+
730+
val ColumnsContainer<MySchema>.test1: DataColumn<String> get() = key
731+
val DataRow<MySchema>.test2: Int get() = value
732+
""".trimIndent()
733+
)
734+
)
735+
)
736+
)
737+
result.successfulCompilation shouldBe true
738+
}
739+
709740
@Test
710741
fun `nested interface`() {
711742
val result = KspCompilationTestRunner.compile(

0 commit comments

Comments
 (0)