Drop @native from stdlib
This commit is contained in:
@@ -62,8 +62,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.jvm.Synchronized", Opcodes.ACC_SYNCHRONIZED)
|
||||
);
|
||||
|
||||
private static final AnnotationVisitor NO_ANNOTATION_VISITOR = new AnnotationVisitor(Opcodes.ASM5) {};
|
||||
|
||||
@@ -29,15 +29,10 @@ import org.jetbrains.kotlin.resolve.diagnostics.SuppressDiagnosticsByAnnotations
|
||||
import org.jetbrains.kotlin.resolve.inline.InlineUtil
|
||||
import org.jetbrains.kotlin.resolve.jvm.diagnostics.ErrorsJvm
|
||||
|
||||
private val NATIVE_ANNOTATION_CLASS_NAME = FqName("kotlin.jvm.native")
|
||||
|
||||
public fun DeclarationDescriptor.hasNativeAnnotation(): Boolean {
|
||||
return this is FunctionDescriptor && this.isExternal
|
||||
|| annotations.findAnnotation(NATIVE_ANNOTATION_CLASS_NAME) != null
|
||||
}
|
||||
|
||||
public class SuppressNoBodyErrorsForNativeDeclarations : SuppressDiagnosticsByAnnotations(FUNCTION_NO_BODY_ERRORS, NATIVE_ANNOTATION_CLASS_NAME)
|
||||
|
||||
public class NativeFunChecker : DeclarationChecker {
|
||||
override fun check(
|
||||
declaration: JetDeclaration,
|
||||
|
||||
@@ -4,8 +4,6 @@
|
||||
<extensions defaultExtensionNs="org.jetbrains.kotlin">
|
||||
<defaultErrorMessages implementation="org.jetbrains.kotlin.resolve.jvm.diagnostics.DefaultErrorMessagesJvm"/>
|
||||
|
||||
<suppressStringProvider implementation="org.jetbrains.kotlin.load.kotlin.nativeDeclarations.SuppressNoBodyErrorsForNativeDeclarations"/>
|
||||
|
||||
<classBuilderInterceptorExtension implementation="org.jetbrains.kotlin.annotation.AnnotationCollectorExtension"/>
|
||||
|
||||
<analyzeCompleteHandlerExtension implementation="org.jetbrains.kotlin.resolve.jvm.AnalyzeCompleteHandlerExtension"/>
|
||||
|
||||
@@ -54,13 +54,4 @@ public annotation class Strictfp
|
||||
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class Synchronized
|
||||
|
||||
/**
|
||||
* Marks the JVM method generated from the annotated function as `native`, meaning that it's not implemented
|
||||
* in Java but rather in a different language (for example, in C/C++ using JNI).
|
||||
*/
|
||||
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@MustBeDocumented
|
||||
public annotation class native
|
||||
public annotation class Synchronized
|
||||
Reference in New Issue
Block a user