Skip to content

Commit bff6e3c

Browse files
authored
Merge pull request #740 from Kotlin/compiler-plugin-fixes
Compiler plugin fixes
2 parents e418f9b + 91fa075 commit bff6e3c

File tree

6 files changed

+16
-28
lines changed

6 files changed

+16
-28
lines changed

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/analyzeRefinedCallShape.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ fun KotlinTypeFacade.analyzeRefinedCallShape(call: FirFunctionCall, reporter: In
3636
return null
3737
}
3838

39-
val newSchema: PluginDataFrameSchema = call.interpreterName(session)?.let {
40-
when (it) {
39+
val newSchema: PluginDataFrameSchema = call.interpreterName(session)?.let { name ->
40+
when (name) {
4141
"toDataFrameDsl" -> {
4242
val list = call.argumentList as FirResolvedArgumentList
4343
val lambda = (list.arguments.singleOrNull() as? FirAnonymousFunctionExpression)?.anonymousFunction
@@ -85,7 +85,7 @@ fun KotlinTypeFacade.analyzeRefinedCallShape(call: FirFunctionCall, reporter: In
8585
PluginDataFrameSchema(emptyList())
8686
}
8787
}
88-
else -> it.load<Interpreter<*>>().let { processor ->
88+
else -> name.load<Interpreter<*>>().let { processor ->
8989
val dataFrameSchema = interpret(call, processor, reporter = reporter)
9090
.let {
9191
val value = it?.value

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/extensions/KotlinTypeFacade.kt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,6 @@ interface KotlinTypeFacade {
3535

3636
fun Marker.type() = type
3737

38-
val anyDataFrame get() = ConeClassLikeTypeImpl(
39-
ConeClassLikeLookupTagImpl(Names.DF_CLASS_ID),
40-
typeArguments = arrayOf(session.builtinTypes.anyType.type),
41-
isNullable = false
42-
).wrap()
43-
44-
val anyRow get() = ConeClassLikeTypeImpl(
45-
ConeClassLikeLookupTagImpl(Names.DATA_ROW_CLASS_ID),
46-
typeArguments = arrayOf(session.builtinTypes.anyType.type),
47-
isNullable = false
48-
).wrap()
49-
5038
fun from(type: KType): Marker {
5139
return Marker(fromImpl(type))
5240
}

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/SimpleCol.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("INVISIBLE_REFERENCE", "CANNOT_OVERRIDE_INVISIBLE_MEMBER")
2+
13
package org.jetbrains.kotlinx.dataframe.plugin.impl
24

35
import org.jetbrains.kotlin.fir.types.ConeKotlinType

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/api/insert.kt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
2+
13
package org.jetbrains.kotlinx.dataframe.plugin.impl.api
24

35
import org.jetbrains.kotlinx.dataframe.plugin.impl.AbstractInterpreter
@@ -9,7 +11,6 @@ import org.jetbrains.kotlinx.dataframe.api.Infer
911
import org.jetbrains.kotlinx.dataframe.api.pathOf
1012
import org.jetbrains.kotlinx.dataframe.api.toPath
1113
import org.jetbrains.kotlinx.dataframe.impl.api.GenericColumnsToInsert
12-
import org.jetbrains.kotlinx.dataframe.impl.api.GenericColumnGroup
1314
import org.jetbrains.kotlinx.dataframe.impl.api.insertImplGenericContainer
1415
import org.jetbrains.kotlinx.dataframe.plugin.impl.PluginDataFrameSchema
1516
import org.jetbrains.kotlinx.dataframe.plugin.impl.SimpleCol
@@ -81,7 +82,7 @@ internal class Under0 : AbstractInterpreter<PluginDataFrameSchema>() {
8182
val Arguments.receiver: InsertClauseApproximation by insertClause()
8283

8384
override fun Arguments.interpret(): PluginDataFrameSchema {
84-
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(column.path.path.toPath(), receiver.column)), anyDataFrame)
85+
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(column.path.path.toPath(), receiver.column)))
8586
}
8687
}
8788

@@ -90,7 +91,7 @@ internal class Under1 : AbstractInterpreter<PluginDataFrameSchema>() {
9091
val Arguments.receiver: InsertClauseApproximation by insertClause()
9192

9293
override fun Arguments.interpret(): PluginDataFrameSchema {
93-
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(columnPath.path.toPath(), receiver.column)), anyRow)
94+
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(columnPath.path.toPath(), receiver.column)))
9495
}
9596
}
9697

@@ -99,7 +100,7 @@ internal class Under2 : AbstractInterpreter<PluginDataFrameSchema>() {
99100
val Arguments.receiver: InsertClauseApproximation by insertClause()
100101

101102
override fun Arguments.interpret(): PluginDataFrameSchema {
102-
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column.name), receiver.column)), anyRow)
103+
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column.name), receiver.column)))
103104
}
104105
}
105106

@@ -108,7 +109,7 @@ internal class Under3 : AbstractInterpreter<PluginDataFrameSchema>() {
108109
val Arguments.receiver: InsertClauseApproximation by insertClause()
109110

110111
override fun Arguments.interpret(): PluginDataFrameSchema {
111-
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column.name), receiver.column)), anyRow)
112+
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column.name), receiver.column)))
112113
}
113114
}
114115

@@ -117,16 +118,15 @@ internal class Under4 : AbstractInterpreter<PluginDataFrameSchema>() {
117118
val Arguments.receiver: InsertClauseApproximation by insertClause()
118119

119120
override fun Arguments.interpret(): PluginDataFrameSchema {
120-
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column), receiver.column)), anyRow)
121+
return receiver.df.insertImpl(listOf(GenericColumnsToInsert(pathOf(column), receiver.column)))
121122
}
122123
}
123124

124125
@PublishedApi
125126
internal fun PluginDataFrameSchema.insertImpl(
126-
columns: List<GenericColumnsToInsert<SimpleCol>>,
127-
columnGroupType: TypeApproximation
127+
columns: List<GenericColumnsToInsert<SimpleCol>>
128128
): PluginDataFrameSchema {
129-
return insertImplGenericContainer<PluginDataFrameSchema, SimpleCol, GenericColumnGroup<SimpleCol>>(
129+
return insertImplGenericContainer(
130130
this,
131131
columns,
132132
columns.firstOrNull()?.referenceNode?.getRoot(),

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/api/join.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("INVISIBLE_REFERENCE", "INVISIBLE_MEMBER")
2+
13
package org.jetbrains.kotlinx.dataframe.plugin.impl.api
24

35
import org.jetbrains.kotlinx.dataframe.plugin.impl.AbstractInterpreter

plugins/kotlin-dataframe/src/org/jetbrains/kotlinx/dataframe/plugin/impl/data/toPluginDataFrameSchema.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ val KotlinTypeFacade.toPluginDataFrameSchema: DataFrameSchema.() -> PluginDataFr
5353
)
5454
}
5555

56-
57-
5856
val KotlinTypeFacade.deserializeToPluginDataFrameSchema: SerializableSchema.() -> PluginDataFrameSchema
5957
get() = {
6058
PluginDataFrameSchema(
@@ -155,7 +153,6 @@ private fun from(type: KType): SerializableKType {
155153
return serializableKType
156154
}
157155

158-
159156
private fun List<KTypeProjection>.mapToConeTypeProjection(): List<TypeProjection> = List(size) {
160157
val typeProjection = get(it)
161158
val type = typeProjection.type
@@ -189,7 +186,6 @@ private fun List<TypeProjection>.mapToConeTypeProjection(): Array<out ConeTypePr
189186
}
190187
}
191188

192-
193189
fun KType.from(): String {
194190
val classifier = classifier ?: error("")
195191
val klass = classifier as? KClass<*> ?: error("")

0 commit comments

Comments
 (0)