KT-3561 Bad RuntimeInvisibleParameterAnnotations on attempt to annotate enum constructor hidden parametrs - name and ordinal

This commit is contained in:
Mikhael Bogdanov
2013-04-30 18:37:38 +04:00
parent a9638d9fa4
commit e72b177adc
4 changed files with 21 additions and 0 deletions
@@ -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
}
@@ -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");