Delete Annotations.kt, move "annotationType" to JVM stdlib
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
package kotlin
|
||||
|
||||
import java.lang.reflect.Proxy
|
||||
|
||||
public fun <T : Annotation> T.annotationType() : Class<out T> {
|
||||
val invocationHandler = Proxy.getInvocationHandler(this)!!
|
||||
val method = this.javaClass.getMethod("annotationType")
|
||||
return invocationHandler.invoke(this, method, array<Object>())!! as Class<out T>
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package kotlin
|
||||
|
||||
import java.lang.annotation.*
|
||||
import java.lang.annotation.Retention
|
||||
import java.lang.annotation.RetentionPolicy
|
||||
import kotlin.jvm.internal.Intrinsic
|
||||
|
||||
/**
|
||||
@@ -27,3 +28,6 @@ Retention(RetentionPolicy.SOURCE)
|
||||
public annotation class volatile
|
||||
|
||||
[Intrinsic("kotlin.synchronized")] public fun <R> synchronized(lock: Any, block: () -> R): R = block()
|
||||
|
||||
public fun <T : Annotation> T.annotationType() : Class<out T> =
|
||||
(this as java.lang.annotation.Annotation).annotationType() as Class<out T>
|
||||
|
||||
Reference in New Issue
Block a user