Skip to content

Commit 375f7fe

Browse files
committed
Fix missing type arguments
1 parent 0761ddd commit 375f7fe

File tree

5 files changed

+36
-12
lines changed

5 files changed

+36
-12
lines changed

compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/IrMemberAccessExpressionBuilder.kt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,16 @@ class IrMemberAccessExpressionBuilder(private val vsApi: VersionSpecificApi) {
2323
private var valueArguments: List<IrExpression> = emptyList()
2424
private var typeArguments: List<IrType> = emptyList()
2525

26+
val typeBuilder = TypeBuilder()
27+
2628
fun types(builder: TypeBuilder.() -> Unit) {
27-
TypeBuilder().builder()
29+
typeBuilder.builder()
2830
}
2931

32+
val valueBuilder = ValueBuilder()
33+
3034
fun values(builder: ValueBuilder.() -> Unit) {
31-
ValueBuilder().builder()
35+
valueBuilder.builder()
3236
}
3337

3438
inner class TypeBuilder {

compiler-plugin/compiler-plugin-backend/src/main/core/kotlinx/rpc/codegen/extension/RpcStubGenerator.kt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,10 @@ internal class RpcStubGenerator(
413413
)
414414

415415
arguments {
416+
types {
417+
+fieldType
418+
}
419+
416420
values {
417421
+lambda
418422
}
@@ -737,6 +741,10 @@ internal class RpcStubGenerator(
737741

738742
val arrayOfCall = irCall(callee, type = ctx.arrayOfAnyNullable).apply arrayOfCall@{
739743
if (methodClass.isObject) {
744+
arguments {
745+
types { +ctx.anyNullable }
746+
}
747+
740748
return@arrayOfCall
741749
}
742750

@@ -1226,6 +1234,13 @@ internal class RpcStubGenerator(
12261234
)
12271235
}.apply mapApply@{
12281236
if (isEmpty) {
1237+
arguments {
1238+
types {
1239+
+ctx.irBuiltIns.stringType
1240+
+rpcCallableType
1241+
}
1242+
}
1243+
12291244
return@mapApply
12301245
}
12311246

@@ -1377,6 +1392,10 @@ internal class RpcStubGenerator(
13771392
)
13781393
}.apply arrayOfCall@{
13791394
if (parameters.isEmpty()) {
1395+
arguments {
1396+
types { +ctx.rpcParameter.defaultType }
1397+
}
1398+
13801399
return@arrayOfCall
13811400
}
13821401

@@ -1593,6 +1612,10 @@ internal class RpcStubGenerator(
15931612
type = anyListType,
15941613
).apply listApply@{
15951614
if (isEmpty) {
1615+
arguments {
1616+
types { +ctx.anyNullable }
1617+
}
1618+
15961619
return@listApply
15971620
}
15981621

compiler-plugin/compiler-plugin-backend/src/main/latest/kotlinx/rpc/codegen/VersionSpecificApiImpl.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,13 @@ object VersionSpecificApiImpl : VersionSpecificApi {
151151

152152

153153
override fun IrMemberAccessExpressionData.buildFor(access: IrMemberAccessExpression<*>) {
154-
access.dispatchReceiver = dispatchReceiver
155-
access.extensionReceiver = extensionReceiver
154+
if (dispatchReceiver != null) {
155+
access.dispatchReceiver = dispatchReceiver
156+
}
157+
158+
if (extensionReceiver != null) {
159+
access.extensionReceiver = extensionReceiver
160+
}
156161

157162
valueArguments.forEachIndexed { index, irExpression ->
158163
access.putValueArgument(index, irExpression)

tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/BoxTestGenerated.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11

22

3-
/*
4-
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
5-
*/
6-
73
package kotlinx.rpc.codegen.test.runners;
84

95
import com.intellij.testFramework.TestDataPath;

tests/compiler-plugin-tests/src/test-gen/kotlinx/rpc/codegen/test/runners/DiagnosticTestGenerated.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11

22

3-
/*
4-
* Copyright 2023-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
5-
*/
6-
73
package kotlinx.rpc.codegen.test.runners;
84

95
import com.intellij.testFramework.TestDataPath;

0 commit comments

Comments
 (0)