Targeting / retention for a set of standard annotations, some inapplicable annotation checks replaced with target check, some fixed tests

This commit is contained in:
Mikhail Glukhikh
2015-07-16 11:35:28 +03:00
parent a75daf85e2
commit 94a00540be
53 changed files with 213 additions and 206 deletions
+13
View File
@@ -16,21 +16,34 @@
package kotlin.js
import kotlin.annotation.AnnotationTarget.*
native
target(CLASSIFIER, FUNCTION, PROPERTY, CONSTRUCTOR, VALUE_PARAMETER)
public annotation class native(public val name: String = "")
native
target(FUNCTION)
public annotation class nativeGetter
native
target(FUNCTION)
public annotation class nativeSetter
native
target(FUNCTION)
public annotation class nativeInvoke
native
target(CLASSIFIER, FUNCTION, PROPERTY)
public annotation class library(public val name: String = "")
native
target(PROPERTY)
public annotation class enumerable()
// TODO make it "internal" or "fake"
native
target(CLASSIFIER)
deprecated("Do not use this annotation: it is for internal use only")
public annotation class marker
+2 -1
View File
@@ -17,4 +17,5 @@
package kotlin.jvm
// is used in common generated code in stdlib
internal annotation class jvmOverloads
target(AnnotationTarget.FUNCTION, AnnotationTarget.CONSTRUCTOR)
internal annotation(retention = AnnotationRetention.SOURCE) class jvmOverloads
+4 -2
View File
@@ -24,9 +24,11 @@ import kotlin.InlineOption.ONLY_LOCAL_RETURN
// They was reserved word in ECMAScript 2, but is not since ECMAScript 5.
native
public annotation class volatile
target(AnnotationTarget.PROPERTY, AnnotationTarget.FIELD)
public annotation(retention = AnnotationRetention.SOURCE) class volatile
native
public annotation class synchronized
target(AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER)
public annotation(retention = AnnotationRetention.SOURCE) class synchronized
public inline fun <R> synchronized(lock: Any, @inlineOptions(ONLY_LOCAL_RETURN) block: () -> R): R = block()