Codegen: fix NPE in NO_ANNOTATION_VISITOR
EA-100245 fixed
This commit is contained in:
@@ -67,7 +67,17 @@ public abstract class AnnotationCodegen {
|
||||
new JvmFlagAnnotation("kotlin.jvm.Synchronized", Opcodes.ACC_SYNCHRONIZED)
|
||||
);
|
||||
|
||||
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {};
|
||||
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {
|
||||
@Override
|
||||
public AnnotationVisitor visitAnnotation(String name, @NotNull String desc) {
|
||||
return safe(super.visitAnnotation(name, desc));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AnnotationVisitor visitArray(String name) {
|
||||
return safe(super.visitArray(name));
|
||||
}
|
||||
};
|
||||
|
||||
private final InnerClassConsumer innerClassConsumer;
|
||||
private final KotlinTypeMapper typeMapper;
|
||||
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
public final class Inheritor implements p.I, p.I2 {
|
||||
public final void f() { /* compiled code */ }
|
||||
|
||||
public void g() { /* compiled code */ }
|
||||
|
||||
public Inheritor() { /* compiled code */ }
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// p.Inheritor
|
||||
package p
|
||||
|
||||
annotation class Anno(vararg val s: String)
|
||||
|
||||
annotation class Bueno(val anno: Anno)
|
||||
|
||||
class Inheritor: I, I2 {
|
||||
|
||||
fun f() {
|
||||
|
||||
}
|
||||
|
||||
override fun g() {
|
||||
}
|
||||
}
|
||||
|
||||
interface I : I1 {
|
||||
fun g()
|
||||
}
|
||||
|
||||
interface I1 {
|
||||
@Bueno(Anno("G"))
|
||||
fun foo() = "foo"
|
||||
}
|
||||
|
||||
interface I2 {
|
||||
@Anno("S")
|
||||
fun bar() = "bar"
|
||||
}
|
||||
@@ -212,6 +212,12 @@ public class IdeLightClassTestGenerated extends AbstractIdeLightClassTest {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/asJava/lightClasses/ideRegression"), Pattern.compile("^([^.]+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("InheritingInterfaceDefaultImpls.kt")
|
||||
public void testInheritingInterfaceDefaultImpls() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/ideRegression/InheritingInterfaceDefaultImpls.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("OverridingFinalInternal.kt")
|
||||
public void testOverridingFinalInternal() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/asJava/lightClasses/ideRegression/OverridingFinalInternal.kt");
|
||||
|
||||
Reference in New Issue
Block a user