JVM IR: do not mangle synthetic methods with inline class parameters
For example, synthetic `$annotations` methods for properties were previously mangled to `$annotations-...`, which breaks annotation loader, and fails an assert in ClassCodegen.generateMethod.
This commit is contained in:
+1
-1
@@ -51,7 +51,7 @@ class MemoizedInlineClassReplacements {
|
|||||||
it.isSyntheticInlineClassMember ||
|
it.isSyntheticInlineClassMember ||
|
||||||
it.origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA ||
|
it.origin == IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA ||
|
||||||
it.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR ||
|
it.origin == IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR ||
|
||||||
it.origin == JvmLoweredDeclarationOrigin.POLYMORPHIC_SIGNATURE_INSTANTIATION -> null
|
it.origin.isSynthetic -> null
|
||||||
it.hasMethodReplacement -> createMethodReplacement(it)
|
it.hasMethodReplacement -> createMethodReplacement(it)
|
||||||
it.hasStaticReplacement -> createStaticReplacement(it)
|
it.hasStaticReplacement -> createStaticReplacement(it)
|
||||||
else -> null
|
else -> null
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// IGNORE_BACKEND_FIR: JVM_IR
|
||||||
|
|
||||||
|
@Target(AnnotationTarget.PROPERTY)
|
||||||
|
annotation class Anno
|
||||||
|
|
||||||
|
inline class Z(val s: String)
|
||||||
|
|
||||||
|
class A {
|
||||||
|
@Anno
|
||||||
|
val Z.r: String get() = s
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
with(A()) {
|
||||||
|
return Z("OK").r
|
||||||
|
}
|
||||||
|
}
|
||||||
+5
@@ -12408,6 +12408,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
+5
@@ -12423,6 +12423,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
+5
@@ -11258,6 +11258,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
+5
@@ -11258,6 +11258,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
Generated
+5
@@ -9743,6 +9743,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
+5
@@ -10883,6 +10883,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/box/inlineClasses"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.JS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("annotatedMemberExtensionProperty.kt")
|
||||||
|
public void testAnnotatedMemberExtensionProperty() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/inlineClasses/annotatedMemberExtensionProperty.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
@TestMetadata("boundCallableReferencePassedToInlineFunction.kt")
|
||||||
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
public void testBoundCallableReferencePassedToInlineFunction() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
runTest("compiler/testData/codegen/box/inlineClasses/boundCallableReferencePassedToInlineFunction.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user