File tree Expand file tree Collapse file tree 2 files changed +34
-5
lines changed
plugins/symbol-processor/src
main/kotlin/org/jetbrains/dataframe/ksp
test/kotlin/org/jetbrains/dataframe/ksp Expand file tree Collapse file tree 2 files changed +34
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ import com.google.devtools.ksp.symbol.KSClassifierReference
12
12
import com.google.devtools.ksp.symbol.KSDeclaration
13
13
import com.google.devtools.ksp.symbol.KSFile
14
14
import com.google.devtools.ksp.symbol.KSName
15
- import com.google.devtools.ksp.symbol.KSPropertyDeclaration
16
15
import com.google.devtools.ksp.symbol.KSTypeReference
17
16
import com.google.devtools.ksp.symbol.KSValueArgument
18
17
import com.google.devtools.ksp.symbol.Modifier
@@ -61,11 +60,10 @@ class ExtensionsGenerator(
61
60
return when {
62
61
isClassOrInterface() && effectivelyPublicOrInternal() -> {
63
62
DataSchemaDeclaration (
64
- this ,
65
- declarations
66
- .filterIsInstance<KSPropertyDeclaration >()
63
+ origin = this ,
64
+ properties = getAllProperties()
67
65
.map { KSAnnotatedWithType (it, it.simpleName, it.type) }
68
- .toList()
66
+ .toList(),
69
67
)
70
68
}
71
69
else -> null
Original file line number Diff line number Diff line change @@ -706,6 +706,37 @@ class DataFrameSymbolProcessorTest {
706
706
result.successfulCompilation shouldBe true
707
707
}
708
708
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
+
709
740
@Test
710
741
fun `nested interface` () {
711
742
val result = KspCompilationTestRunner .compile(
You can’t perform that action at this time.
0 commit comments