rename platformStatic to jvmStatic

This commit is contained in:
Dmitry Jemerov
2015-08-21 12:57:54 +02:00
parent 4053c19260
commit 341f09afd3
51 changed files with 145 additions and 181 deletions
@@ -66,7 +66,11 @@ open class KFunctionImpl protected constructor(
is Constructor<*> -> FunctionCaller.Constructor(member)
is Method -> when {
!Modifier.isStatic(member.modifiers) -> FunctionCaller.InstanceMethod(member)
descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null -> FunctionCaller.PlatformStaticInObject(member)
descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null,
descriptor.annotations.findAnnotation(JVM_STATIC) != null->
FunctionCaller.PlatformStaticInObject(member)
else -> FunctionCaller.StaticMethod(member)
}
else -> throw KotlinReflectionInternalError("Call is not yet supported for this function: $descriptor")
@@ -80,7 +80,8 @@ interface KMutablePropertyImpl<R> : KMutableProperty<R>, KPropertyImpl<R> {
private fun KPropertyImpl.Accessor<*>.computeCallerForAccessor(isGetter: Boolean): FunctionCaller<*> {
fun isPlatformStaticProperty() =
property.descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null
property.descriptor.annotations.findAnnotation(PLATFORM_STATIC) != null ||
property.descriptor.annotations.findAnnotation(JVM_STATIC) != null
fun isNotNullProperty() =
!TypeUtils.isNullableType(property.descriptor.type)
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.name.FqName
import kotlin.reflect.IllegalCallableAccessException
internal val PLATFORM_STATIC = FqName("kotlin.platform.platformStatic")
internal val JVM_STATIC = FqName("kotlin.jvm.jvmStatic")
// TODO: wrap other exceptions
internal inline fun <R> reflectionCall(block: () -> R): R =