@@ -30,6 +30,7 @@ import org.jetbrains.kotlin.fir.types.ConeKotlinType
30
30
import org.jetbrains.kotlin.fir.types.ConeNullability
31
31
import org.jetbrains.kotlin.fir.types.ConeStarProjection
32
32
import org.jetbrains.kotlin.fir.types.ConeTypeParameterType
33
+ import org.jetbrains.kotlin.fir.types.ConeTypeProjection
33
34
import org.jetbrains.kotlin.fir.types.canBeNull
34
35
import org.jetbrains.kotlin.fir.types.classId
35
36
import org.jetbrains.kotlin.fir.types.coneType
@@ -52,7 +53,6 @@ import org.jetbrains.kotlin.name.FqName
52
53
import org.jetbrains.kotlin.name.Name
53
54
import org.jetbrains.kotlin.name.StandardClassIds
54
55
import org.jetbrains.kotlin.name.StandardClassIds.List
55
- import org.jetbrains.kotlin.types.checker.SimpleClassicTypeSystemContext.withNullability
56
56
import org.jetbrains.kotlinx.dataframe.codeGen.*
57
57
import org.jetbrains.kotlinx.dataframe.plugin.extensions.KotlinTypeFacade
58
58
import org.jetbrains.kotlinx.dataframe.plugin.extensions.wrap
@@ -77,27 +77,31 @@ import java.util.*
77
77
class ToDataFrameDsl : AbstractSchemaModificationInterpreter () {
78
78
val Arguments .receiver: FirExpression ? by arg(lens = Interpreter .Id )
79
79
val Arguments .body by dsl()
80
+ val Arguments .typeArg0: ConeTypeProjection ? by arg(lens = Interpreter .Id )
81
+
80
82
override fun Arguments.interpret (): PluginDataFrameSchema {
81
83
val dsl = CreateDataFrameDslImplApproximation ()
82
- body(dsl, mapOf (" explicitReceiver " to Interpreter .Success (receiver )))
84
+ body(dsl, mapOf (" typeArg0 " to Interpreter .Success (typeArg0 )))
83
85
return PluginDataFrameSchema (dsl.columns)
84
86
}
85
87
}
86
88
87
89
class ToDataFrame : AbstractSchemaModificationInterpreter () {
88
90
val Arguments .receiver: FirExpression ? by arg(lens = Interpreter .Id )
89
91
val Arguments .maxDepth: Number by arg(defaultValue = Present (DEFAULT_MAX_DEPTH ))
92
+ val Arguments .typeArg0: ConeTypeProjection by arg(lens = Interpreter .Id )
90
93
91
94
override fun Arguments.interpret (): PluginDataFrameSchema {
92
- return toDataFrame(maxDepth.toInt(), receiver , TraverseConfiguration ())
95
+ return toDataFrame(maxDepth.toInt(), typeArg0 , TraverseConfiguration ())
93
96
}
94
97
}
95
98
96
99
class ToDataFrameDefault : AbstractSchemaModificationInterpreter () {
97
100
val Arguments .receiver: FirExpression ? by arg(lens = Interpreter .Id )
101
+ val Arguments .typeArg0: ConeTypeProjection by arg(lens = Interpreter .Id )
98
102
99
103
override fun Arguments.interpret (): PluginDataFrameSchema {
100
- return toDataFrame(DEFAULT_MAX_DEPTH , receiver , TraverseConfiguration ())
104
+ return toDataFrame(DEFAULT_MAX_DEPTH , typeArg0 , TraverseConfiguration ())
101
105
}
102
106
}
103
107
@@ -115,14 +119,14 @@ private const val DEFAULT_MAX_DEPTH = 0
115
119
116
120
class Properties0 : AbstractInterpreter <Unit >() {
117
121
val Arguments .dsl: CreateDataFrameDslImplApproximation by arg()
118
- val Arguments .explicitReceiver: FirExpression ? by arg()
119
122
val Arguments .maxDepth: Int by arg()
120
123
val Arguments .body by dsl()
124
+ val Arguments .typeArg0: ConeTypeProjection by arg(lens = Interpreter .Id )
121
125
122
126
override fun Arguments.interpret () {
123
127
dsl.configuration.maxDepth = maxDepth
124
128
body(dsl.configuration.traverseConfiguration, emptyMap())
125
- val schema = toDataFrame(dsl.configuration.maxDepth, explicitReceiver , dsl.configuration.traverseConfiguration)
129
+ val schema = toDataFrame(dsl.configuration.maxDepth, typeArg0 , dsl.configuration.traverseConfiguration)
126
130
dsl.columns.addAll(schema.columns())
127
131
}
128
132
}
@@ -178,8 +182,8 @@ class Exclude1 : AbstractInterpreter<Unit>() {
178
182
@OptIn(SymbolInternals ::class )
179
183
internal fun KotlinTypeFacade.toDataFrame (
180
184
maxDepth : Int ,
181
- explicitReceiver : FirExpression ? ,
182
- traverseConfiguration : TraverseConfiguration
185
+ arg : ConeTypeProjection ,
186
+ traverseConfiguration : TraverseConfiguration ,
183
187
): PluginDataFrameSchema {
184
188
fun ConeKotlinType.isValueType () =
185
189
this .isArrayTypeOrNullableArrayType ||
@@ -290,8 +294,6 @@ internal fun KotlinTypeFacade.toDataFrame(
290
294
}
291
295
}
292
296
293
- val receiver = explicitReceiver ? : return PluginDataFrameSchema .EMPTY
294
- val arg = receiver.resolvedType.typeArguments.firstOrNull() ? : return PluginDataFrameSchema .EMPTY
295
297
return when {
296
298
arg.isStarProjection -> PluginDataFrameSchema .EMPTY
297
299
else -> {
0 commit comments