Generate annotations in proper order in DefaultImpls
This commit is contained in:
@@ -223,8 +223,7 @@ public class FunctionCodegen {
|
|||||||
|
|
||||||
generateMethodAnnotations(functionDescriptor, asmMethod, mv);
|
generateMethodAnnotations(functionDescriptor, asmMethod, mv);
|
||||||
|
|
||||||
JvmMethodSignature signature = typeMapper.mapSignatureSkipGeneric(functionDescriptor);
|
generateParameterAnnotations(functionDescriptor, mv, jvmSignature);
|
||||||
generateParameterAnnotations(functionDescriptor, mv, signature);
|
|
||||||
GenerateJava8ParameterNamesKt.generateParameterNames(functionDescriptor, mv, jvmSignature, state, (flags & ACC_SYNTHETIC) != 0);
|
GenerateJava8ParameterNamesKt.generateParameterNames(functionDescriptor, mv, jvmSignature, state, (flags & ACC_SYNTHETIC) != 0);
|
||||||
|
|
||||||
generateBridges(functionDescriptor);
|
generateBridges(functionDescriptor);
|
||||||
|
|||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
// FULL_JDK
|
||||||
|
// WITH_REFLECT
|
||||||
|
// IGNORE_BACKEND: JS, NATIVE
|
||||||
|
|
||||||
|
annotation class Anno(val value: String)
|
||||||
|
|
||||||
|
interface Test {
|
||||||
|
fun foo(@Anno("OK") a: String) = "123"
|
||||||
|
}
|
||||||
|
|
||||||
|
fun box(): String {
|
||||||
|
val testMethod = Class.forName("Test\$DefaultImpls").declaredMethods.single()
|
||||||
|
//return (::test.parameters.single().annotations.single() as Simple).value
|
||||||
|
val receiverAnnotations = (testMethod.parameters[0]).annotations
|
||||||
|
if (receiverAnnotations.isNotEmpty()) return "fail: receiver parameter should not have any annotations, but: ${receiverAnnotations.joinToString()}"
|
||||||
|
|
||||||
|
val value2 = ((testMethod.parameters[1]).annotations.single() as Anno).value
|
||||||
|
|
||||||
|
return value2
|
||||||
|
}
|
||||||
+6
@@ -128,6 +128,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("parameterAnnotationInDefaultImpls.kt")
|
||||||
|
public void testParameterAnnotationInDefaultImpls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("parameterWithPrimitiveType.kt")
|
@TestMetadata("parameterWithPrimitiveType.kt")
|
||||||
public void testParameterWithPrimitiveType() throws Exception {
|
public void testParameterWithPrimitiveType() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
||||||
|
|||||||
@@ -128,6 +128,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("parameterAnnotationInDefaultImpls.kt")
|
||||||
|
public void testParameterAnnotationInDefaultImpls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("parameterWithPrimitiveType.kt")
|
@TestMetadata("parameterWithPrimitiveType.kt")
|
||||||
public void testParameterWithPrimitiveType() throws Exception {
|
public void testParameterWithPrimitiveType() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
||||||
|
|||||||
@@ -140,6 +140,12 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("parameterAnnotationInDefaultImpls.kt")
|
||||||
|
public void testParameterAnnotationInDefaultImpls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("parameterWithPrimitiveType.kt")
|
@TestMetadata("parameterWithPrimitiveType.kt")
|
||||||
public void testParameterWithPrimitiveType() throws Exception {
|
public void testParameterWithPrimitiveType() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
||||||
|
|||||||
+12
@@ -212,6 +212,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("parameterAnnotationInDefaultImpls.kt")
|
||||||
|
public void testParameterAnnotationInDefaultImpls() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterAnnotationInDefaultImpls.kt");
|
||||||
|
try {
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
catch (Throwable ignore) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw new AssertionError("Looks like this test can be unmuted. Remove IGNORE_BACKEND directive for that.");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("parameterWithPrimitiveType.kt")
|
@TestMetadata("parameterWithPrimitiveType.kt")
|
||||||
public void testParameterWithPrimitiveType() throws Exception {
|
public void testParameterWithPrimitiveType() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/codegen/box/annotations/parameterWithPrimitiveType.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user