Generate ACC_NATIVE for external
This commit is contained in:
@@ -63,8 +63,7 @@ public abstract class AnnotationCodegen {
|
||||
public static final List<JvmFlagAnnotation> METHOD_FLAGS = Arrays.asList(
|
||||
new JvmFlagAnnotation("kotlin.jvm.Strictfp", Opcodes.ACC_STRICT),
|
||||
new JvmFlagAnnotation("kotlin.jvm.Synchronized", Opcodes.ACC_SYNCHRONIZED),
|
||||
new JvmFlagAnnotation("kotlin.jvm.native", Opcodes.ACC_NATIVE),
|
||||
new JvmFlagAnnotation("kotlin.external", Opcodes.ACC_NATIVE)
|
||||
new JvmFlagAnnotation("kotlin.jvm.native", Opcodes.ACC_NATIVE)
|
||||
);
|
||||
|
||||
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {};
|
||||
|
||||
@@ -192,6 +192,10 @@ public class AsmUtil {
|
||||
}
|
||||
}
|
||||
|
||||
if (functionDescriptor.getOriginal().isExternal()) {
|
||||
flags |= Opcodes.ACC_NATIVE;
|
||||
}
|
||||
|
||||
if (AnnotationUtilKt.isPlatformStaticInCompanionObject(functionDescriptor)) {
|
||||
// Native method will be a member of the class, the companion object method will be delegated to it
|
||||
flags &= ~Opcodes.ACC_NATIVE;
|
||||
|
||||
Reference in New Issue
Block a user