Introduce platform specific annotations as optional in common stdlib

#KT-24478
This commit is contained in:
Ilya Gorbunov
2018-05-24 20:18:52 +03:00
parent ce7a863843
commit 0c89996e34
9 changed files with 148 additions and 45 deletions
@@ -3,6 +3,7 @@
* that can be found in the license/LICENSE.txt file.
*/
@file:Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
package kotlin.jvm
import kotlin.annotation.AnnotationTarget.*
@@ -11,7 +12,6 @@ import kotlin.annotation.AnnotationTarget.*
* Marks the JVM backing field of the annotated property as `volatile`, meaning that writes to this field
* are immediately made visible to other threads.
*/
@Suppress("ACTUAL_WITHOUT_EXPECT") // for building kotlin-runtime
@Target(FIELD)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
@@ -24,7 +24,7 @@ public actual annotation class Volatile
@Target(FIELD)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Transient
public actual annotation class Transient
/**
* Marks the JVM method generated from the annotated function as `strictfp`, meaning that the precision
@@ -34,7 +34,7 @@ public annotation class Transient
@Target(FUNCTION, CONSTRUCTOR, PROPERTY_GETTER, PROPERTY_SETTER, CLASS)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Strictfp
public actual annotation class Strictfp
/**
* Marks the JVM method generated from the annotated function as `synchronized`, meaning that the method
@@ -44,4 +44,4 @@ public annotation class Strictfp
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(AnnotationRetention.SOURCE)
@MustBeDocumented
public annotation class Synchronized
public actual annotation class Synchronized
@@ -18,7 +18,7 @@ import kotlin.reflect.KClass
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
public annotation class JvmOverloads
public actual annotation class JvmOverloads
/**
* Specifies that an additional static method needs to be generated from this element if it's a function.
@@ -30,7 +30,7 @@ public annotation class JvmOverloads
@Target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
public annotation class JvmStatic
public actual annotation class JvmStatic
/**
* Specifies the name for the Java class or method which is generated from this element.
@@ -124,7 +124,7 @@ public actual annotation class JvmField
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
public annotation class JvmSuppressWildcards(val suppress: Boolean = true)
public actual annotation class JvmSuppressWildcards(actual val suppress: Boolean = true)
/**
* Instructs compiler to generate wildcard for annotated type arguments corresponding to parameters with declaration-site variance.
@@ -134,4 +134,4 @@ public annotation class JvmSuppressWildcards(val suppress: Boolean = true)
@Target(AnnotationTarget.TYPE)
@Retention(AnnotationRetention.BINARY)
@MustBeDocumented
public annotation class JvmWildcard
public actual annotation class JvmWildcard