File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl
dataframe-jdbc/src/main/kotlin/org/jetbrains/kotlinx/dataframe/io/db Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import java.net.URL
16
16
import java.time.LocalDateTime
17
17
import java.time.LocalTime
18
18
import kotlin.reflect.KType
19
+ import kotlin.reflect.KVariance
19
20
import kotlin.reflect.full.isSubtypeOf
20
21
import kotlin.reflect.jvm.jvmErasure
21
22
import kotlin.reflect.typeOf
@@ -89,7 +90,12 @@ internal fun renderType(type: KType?): String {
89
90
append(name)
90
91
if (type.arguments.isNotEmpty()) {
91
92
val arguments = type.arguments.joinToString {
92
- renderType(it.type)
93
+ when (it.variance) {
94
+ null -> " *"
95
+ KVariance .INVARIANT -> renderType(it.type)
96
+ KVariance .IN -> " in ${renderType(it.type)} "
97
+ KVariance .OUT -> " out ${renderType(it.type)} "
98
+ }
93
99
}
94
100
append(" <$arguments >" )
95
101
}
Original file line number Diff line number Diff line change @@ -132,7 +132,7 @@ public object DuckDb : DbType("duckdb") {
132
132
Map ::class .createType(
133
133
listOf (
134
134
KTypeProjection .invariant(key.toKType(false )),
135
- KTypeProjection .covariant (value.toKType(true )),
135
+ KTypeProjection .invariant (value.toKType(true )),
136
136
),
137
137
)
138
138
}
@@ -141,7 +141,7 @@ public object DuckDb : DbType("duckdb") {
141
141
// TODO requires #1266 and #1273 for specific types
142
142
// val listType = parseListType(sqlTypeName)
143
143
// Array::class.createType(
144
- // listOf(KTypeProjection.covariant (listType.toKType(true))),
144
+ // listOf(KTypeProjection.invariant (listType.toKType(true))),
145
145
// )
146
146
typeOf<Array >()
147
147
}
You can’t perform that action at this time.
0 commit comments