[KAPT] KT-65399 Fix rendering of types with names starting with $.

Solves a specific issue with Kotlin serialization, and most likely,
similar issues with synthetic classes.

Types with `$` in other positions will be still rendered incorrectly
due to imprecise conversion of such types from Kotlin to Java
in the analysis API.


Merge-request: KT-MR-14235
Merged-by: Pavel Mikhailovskii <Pavel.Mikhailovskii@jetbrains.com>
This commit is contained in:
Pavel Mikhailovskii
2024-02-12 11:15:36 +00:00
committed by Space Team
parent 58264e177f
commit d75463a7d5
5 changed files with 64 additions and 6 deletions
@@ -0,0 +1,5 @@
package org.jetbrains
class C {
object `$serializer`
}
@@ -0,0 +1,39 @@
package org.jetbrains;
/**
* public final class org/jetbrains/C : kotlin/Any {
*
* // signature: <init>()V
* public constructor()
*
* // nested class: $serializer
*
* // module name: main
* }
*/
@kotlin.Metadata()
public final class C {
public C() {
super();
}
/**
* public final object org/jetbrains/C.$serializer : kotlin/Any {
*
* // signature: <init>()V
* private constructor()
*
* // module name: main
* }
*/
@kotlin.Metadata()
public static final class $serializer {
@org.jetbrains.annotations.NotNull()
public static final org.jetbrains.C.$serializer INSTANCE = null;
private $serializer() {
super();
}
}
}
@@ -511,6 +511,12 @@ public class IrClassFileToSourceStubConverterTestGenerated extends AbstractIrCla
runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt61729.kt");
}
@Test
@TestMetadata("kt65399.kt")
public void testKt65399() throws Exception {
runTest("plugins/kapt3/kapt3-compiler/testData/converter/kt65399.kt");
}
@Test
@TestMetadata("kt65453.kt")
public void testKt65453() throws Exception {