KT-3561 Bad RuntimeInvisibleParameterAnnotations on attempt to annotate enum constructor hidden parametrs - name and ordinal
This commit is contained in:
@@ -385,6 +385,9 @@ public class FunctionCodegen extends GenerationStateAware {
|
||||
if (kind == JvmMethodParameterKind.VALUE) {
|
||||
parameterDescriptor = valueParameters.next();
|
||||
parameterName = parameterDescriptor.getName().getName();
|
||||
} else if (kind == JvmMethodParameterKind.ENUM_NAME || kind == JvmMethodParameterKind.ENUM_ORDINAL) {
|
||||
//we shouldn't generate annotations for invisible in runtime parameters otherwise we get bad RuntimeInvisibleParameterAnnotations error in javac
|
||||
continue;
|
||||
} else if (needIndexForVar(kind)) {
|
||||
parameterName = parameterName + "$" + i;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package test;
|
||||
|
||||
public class kt3561 {
|
||||
public MyEnum getEntryName() {
|
||||
return MyEnum.OK;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package test
|
||||
|
||||
enum class MyEnum {
|
||||
OK
|
||||
}
|
||||
|
||||
+5
@@ -73,6 +73,11 @@ public class CompileJavaAgainstKotlinTestGenerated extends AbstractCompileJavaAg
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/class/ImplementsMapPP.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("kt3561.kt")
|
||||
public void testKt3561() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/class/kt3561.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("Simple.kt")
|
||||
public void testSimple() throws Exception {
|
||||
doTest("compiler/testData/compileJavaAgainstKotlin/class/Simple.kt");
|
||||
|
||||
Reference in New Issue
Block a user