KT-57714 Fix remapping of signatures with reified type parameters

This commit is contained in:
Pavel Mikhailovskii
2023-04-18 11:56:20 +02:00
committed by Space Team
parent e10e821cd4
commit 3bb66e8432
5 changed files with 36 additions and 1 deletions
@@ -36,7 +36,7 @@ class AsmTypeRemapper(val typeRemapper: TypeRemapper, val result: InlineResult)
if (mapping.isReified) {
result.reifiedTypeParametersUsages.mergeAll(mapping.reifiedTypeParametersUsages)
}
SignatureReader(mapping.signature).accept(v)
SignatureReader(mapping.signature).acceptType(v)
return
}
return super.visitTypeVariable(name)
@@ -4160,6 +4160,12 @@ public class FirLightTreeBytecodeTextTestGenerated extends AbstractFirLightTreeB
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt56104.kt");
}
@Test
@TestMetadata("kt57714.kt")
public void testKt57714() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt57714.kt");
}
@Test
@TestMetadata("nestedClassInAnnotationArgument.kt")
public void testNestedClassInAnnotationArgument() throws Exception {
@@ -4160,6 +4160,12 @@ public class FirPsiBytecodeTextTestGenerated extends AbstractFirPsiBytecodeTextT
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt56104.kt");
}
@Test
@TestMetadata("kt57714.kt")
public void testKt57714() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt57714.kt");
}
@Test
@TestMetadata("nestedClassInAnnotationArgument.kt")
public void testNestedClassInAnnotationArgument() throws Exception {
@@ -0,0 +1,17 @@
// TARGET_BACKEND: JVM_IR
val x = createImpl<List<String>>()
interface IfaceWithGenericFun<A> {
fun <B : A> doStuff(x: B)
}
inline fun <reified A> createImpl(): IfaceWithGenericFun<A> {
return object : IfaceWithGenericFun<A> {
override fun <B : A> doStuff(x: B) {}
}
}
// 3 INNERCLASS
// 2 INNERCLASS Kt57714Kt\$createImpl\$1 null null
// 1 INNERCLASS Kt57714Kt\$special\$\$inlined\$createImpl\$1 null null
@@ -4160,6 +4160,12 @@ public class IrBytecodeTextTestGenerated extends AbstractIrBytecodeTextTest {
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt56104.kt");
}
@Test
@TestMetadata("kt57714.kt")
public void testKt57714() throws Exception {
runTest("compiler/testData/codegen/bytecodeText/innerClasses/kt57714.kt");
}
@Test
@TestMetadata("nestedClassInAnnotationArgument.kt")
public void testNestedClassInAnnotationArgument() throws Exception {