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 @@ -748,6 +748,37 @@ class DataFrameSymbolProcessorTest {
748
748
result.successfulCompilation shouldBe true
749
749
}
750
750
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
+
751
782
@Test
752
783
fun `nested interface` () {
753
784
val result = KspCompilationTestRunner .compile(
You can’t perform that action at this time.
0 commit comments